Skip to content

Commit fab7930

Browse files
committed
Add more if_tun.h constants
We specifically need IFF_VNET_HDR and IFF_MULTI_QUEUE to build the new version of crosvm. I plan on upstreaming this after the crosvm merge is unblocked. Test: m liblibc Bug: 228847818 Change-Id: I35427758812805b9895e8745aed686c9b85c33c2
1 parent fe72f08 commit fab7930

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

patches/if_tun.diff

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs
2+
index 236f57a4..fe2d2096 100644
3+
--- a/src/unix/linux_like/android/mod.rs
4+
+++ b/src/unix/linux_like/android/mod.rs
5+
@@ -2168,9 +2168,20 @@ pub const NFT_TRACETYPE_RULE: ::c_int = 3;
6+
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
7+
pub const NFT_NG_RANDOM: ::c_int = 1;
8+
9+
+// bionic/libc/kernel/uapi/linux/if_tun.h
10+
pub const IFF_TUN: ::c_int = 0x0001;
11+
pub const IFF_TAP: ::c_int = 0x0002;
12+
+pub const IFF_NAPI: ::c_int = 0x0010;
13+
+pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
14+
pub const IFF_NO_PI: ::c_int = 0x1000;
15+
+pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
16+
+pub const IFF_VNET_HDR: ::c_int = 0x4000;
17+
+pub const IFF_TUN_EXCL: ::c_int = 0x8000;
18+
+pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
19+
+pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
20+
+pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
21+
+pub const IFF_PERSIST: ::c_int = 0x0800;
22+
+pub const IFF_NOFILTER: ::c_int = 0x1000;
23+
24+
// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
25+
// from https://android.googlesource.com/

src/unix/linux_like/android/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,9 +2168,20 @@ pub const NFT_TRACETYPE_RULE: ::c_int = 3;
21682168
pub const NFT_NG_INCREMENTAL: ::c_int = 0;
21692169
pub const NFT_NG_RANDOM: ::c_int = 1;
21702170

2171+
// bionic/libc/kernel/uapi/linux/if_tun.h
21712172
pub const IFF_TUN: ::c_int = 0x0001;
21722173
pub const IFF_TAP: ::c_int = 0x0002;
2174+
pub const IFF_NAPI: ::c_int = 0x0010;
2175+
pub const IFF_NAPI_FRAGS: ::c_int = 0x0020;
21732176
pub const IFF_NO_PI: ::c_int = 0x1000;
2177+
pub const IFF_ONE_QUEUE: ::c_int = 0x2000;
2178+
pub const IFF_VNET_HDR: ::c_int = 0x4000;
2179+
pub const IFF_TUN_EXCL: ::c_int = 0x8000;
2180+
pub const IFF_MULTI_QUEUE: ::c_int = 0x0100;
2181+
pub const IFF_ATTACH_QUEUE: ::c_int = 0x0200;
2182+
pub const IFF_DETACH_QUEUE: ::c_int = 0x0400;
2183+
pub const IFF_PERSIST: ::c_int = 0x0800;
2184+
pub const IFF_NOFILTER: ::c_int = 0x1000;
21742185

21752186
// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h
21762187
// from https://android.googlesource.com/

0 commit comments

Comments
 (0)