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

Add IFF_* constants to linux, android and fuchsia #916

Merged
merged 1 commit into from
Feb 7, 2018

Conversation

LuoZijun
Copy link
Contributor

@LuoZijun LuoZijun commented Feb 4, 2018

Add constants to android and fuchsia:

  • IFF_TUN
  • IFF_TAP
  • IFF_NO_PI

Type problem: #915

so change constants type libc::c_short to libc::c_int :

  • IFF_*

@alexcrichton
Copy link
Member

Thanks! Unfortunately we can't change the types as that'd be a breaking change, but the additions are certainly possible!

@LuoZijun LuoZijun force-pushed the patch-1 branch 3 times, most recently from 9ea9d37 to ae1b5f7 Compare February 7, 2018 02:34
@LuoZijun
Copy link
Contributor Author

LuoZijun commented Feb 7, 2018

@alexcrichton ok, updated.

@@ -445,6 +445,16 @@ pub const IFF_PORTSEL: ::c_int = 0x2000;
pub const IFF_AUTOMEDIA: ::c_int = 0x4000;
pub const IFF_DYNAMIC: ::c_int = 0x8000;

cfg_if! {
if #[cfg(target_os = "android")] {
pub const IFF_TUN: ::c_int = 0x0001;
Copy link
Member

Choose a reason for hiding this comment

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

Could these be moved into the android folder to avoid the cfg_if!?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

okay, no problem.

by the way, should keep IFF_TUN/IFF_TAP/IFF_NO_PI type is same as linux ?

Copy link
Member

Choose a reason for hiding this comment

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

Nah I think it's fine to fix the type for new definitions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, updated.

@LuoZijun
Copy link
Contributor Author

LuoZijun commented Feb 7, 2018

@alexcrichton Done.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Feb 7, 2018

📌 Commit 0f4ae0b has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Feb 7, 2018

⌛ Testing commit 0f4ae0b with merge bbda50d...

bors added a commit that referenced this pull request Feb 7, 2018
Add `IFF_*` constants  to linux, android and fuchsia

Add constants to android and fuchsia:

*    IFF_TUN
*    IFF_TAP
*    IFF_NO_PI

Type problem: #915

so change constants type `libc::c_short` to `libc::c_int` :

*    IFF_*
@bors
Copy link
Contributor

bors commented Feb 7, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing bbda50d to master...

@bors bors merged commit 0f4ae0b into rust-lang:master Feb 7, 2018
@LuoZijun LuoZijun deleted the patch-1 branch February 7, 2018 04:10
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.

None yet

3 participants