Merge pull request #6027 from liornm:fix-unused-flag

PiperOrigin-RevId: 375740504
This commit is contained in:
gVisor bot
2021-05-25 10:43:58 -07:00
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -26,4 +26,7 @@ const (
IFF_TAP = 0x0002
IFF_NO_PI = 0x1000
IFF_NOFILTER = 0x1000
// According to linux/if_tun.h "This flag has no real effect"
IFF_ONE_QUEUE = 0x2000
)
+1 -1
View File
@@ -40,7 +40,7 @@ func LinuxToTUNFlags(flags uint16) (tun.Flags, error) {
// Linux adds IFF_NOFILTER (the same value as IFF_NO_PI unfortunately)
// when there is no sk_filter. See __tun_chr_ioctl() in
// net/drivers/tun.c.
if flags&^uint16(linux.IFF_TUN|linux.IFF_TAP|linux.IFF_NO_PI) != 0 {
if flags&^uint16(linux.IFF_TUN|linux.IFF_TAP|linux.IFF_NO_PI|linux.IFF_ONE_QUEUE) != 0 {
return tun.Flags{}, syserror.EINVAL
}
return tun.Flags{