Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update InterfaceFlags #853

Merged
merged 1 commit into from
Feb 8, 2018
Merged

Update InterfaceFlags #853

merged 1 commit into from
Feb 8, 2018

Conversation

LuoZijun
Copy link
Contributor

Add Flags: IFF_NO_PI, IFF_TUN, IFF_TAP.

@Susurrus
Copy link
Contributor

Susurrus commented Feb 1, 2018

Looks like Android is failing. Are these flags available on Android? If so, they should be added to libc.

@LuoZijun
Copy link
Contributor Author

LuoZijun commented Feb 1, 2018

i will check android later.

@asomers
Copy link
Member

asomers commented Feb 3, 2018

Needs an entry in the CHANGELOG. Otherwise, LGTM.

src/net/if_.rs Outdated
@@ -215,6 +215,15 @@ libc_bitflags!(
/// Don't exchange routing info.
#[cfg(any(target_os = "solaris"))]
IFF_NORTEXCH;
/// Do not provide packet information
#[cfg(any(target_os = "linux"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove any(

src/net/if_.rs Outdated
#[cfg(any(target_os = "linux"))]
IFF_NO_PI as i32;
/// TUN device (no Ethernet headers)
#[cfg(any(target_os = "linux"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove any(

src/net/if_.rs Outdated
#[cfg(any(target_os = "linux"))]
IFF_TUN as i32;
/// TAP device
#[cfg(any(target_os = "linux"))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove any(

src/net/if_.rs Outdated
@@ -215,6 +215,15 @@ libc_bitflags!(
/// Don't exchange routing info.
#[cfg(any(target_os = "solaris"))]
IFF_NORTEXCH;
/// Do not provide packet information
#[cfg(any(target_os = "linux"))]
IFF_NO_PI as i32;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be c_int for all 3 of these to match the enum declaration.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's done

@LuoZijun LuoZijun force-pushed the patch-1 branch 2 times, most recently from 2075aa7 to 147f63a Compare February 4, 2018 11:30
@LuoZijun
Copy link
Contributor Author

LuoZijun commented Feb 4, 2018

upstream PR: rust-lang/libc#916

@LuoZijun LuoZijun force-pushed the patch-1 branch 3 times, most recently from 21d30e2 to b7868e5 Compare February 7, 2018 04:22
@LuoZijun
Copy link
Contributor Author

LuoZijun commented Feb 7, 2018

@Susurrus ping ...

@Susurrus
Copy link
Contributor

Susurrus commented Feb 7, 2018

Please add a link to the PR in the CHANGELOG like the other entries do.

@LuoZijun
Copy link
Contributor Author

LuoZijun commented Feb 7, 2018

Updated.

Copy link
Contributor

@Susurrus Susurrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This last change than LGTM

CHANGELOG.md Outdated
@@ -10,6 +10,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- Display and Debug for SysControlAddr now includes all fields.
([#837](https://github.com/nix-rust/nix/pull/837))
- `nix::net::if_::InterfaceFlags` now support `IFF_NO_PI/IFF_TUN/IFF_TAP` flags on linux-like system.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically an addition since the interface didn't change, but new functionally was added. Please move it to the Added section.

Also change "system" to "systems"

@LuoZijun LuoZijun force-pushed the patch-1 branch 2 times, most recently from 69d0f76 to 42deadf Compare February 8, 2018 00:45
Add Flags: `IFF_NO_PI`, `IFF_TUN`, `IFF_TAP`.
@Susurrus
Copy link
Contributor

Susurrus commented Feb 8, 2018

bors r+

bors bot added a commit that referenced this pull request Feb 8, 2018
853: Update `InterfaceFlags` r=Susurrus a=LuoZijun

Add Flags: `IFF_NO_PI`, `IFF_TUN`, `IFF_TAP`.
@bors
Copy link
Contributor

bors bot commented Feb 8, 2018

@bors bors bot merged commit c755da8 into nix-rust:master Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants