linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] if_tun: add TUNSETVNETLE/TUNGETVNETLE
       [not found] <1418732988-3535-1-git-send-email-mst@redhat.com>
@ 2014-12-16 13:05 ` Michael S. Tsirkin
  2014-12-16 13:05 ` [PATCH 5/5] if_tun: drop broken IFF_VNET_LE Michael S. Tsirkin
  1 sibling, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2014-12-16 13:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Miller, netdev, Dan Carpenter, linux-api, Jason Wang

ifreq flags field is only 16 bit wide, so setting IFF_VNET_LE there has
no effect:
doesn't fit in two bytes.

The tests passed apparently because they have an even number of bugs,
all cancelling out.

Luckily we didn't release a kernel with this flag, so it's
not too late to fix this.

Add TUNSETVNETLE/TUNGETVNETLE to really achieve the purpose
of IFF_VNET_LE.

This has an added benefit that if we ever want a BE flag,
we won't have to deal with weird configurations like
setting both LE and BE at the same time.

IFF_VNET_LE will be dropped in a follow-up patch.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/uapi/linux/if_tun.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 18b2403..274630c 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -48,6 +48,8 @@
 #define TUNSETQUEUE  _IOW('T', 217, int)
 #define TUNSETIFINDEX	_IOW('T', 218, unsigned int)
 #define TUNGETFILTER _IOR('T', 219, struct sock_fprog)
+#define TUNSETVNETLE _IOW('T', 220, int)
+#define TUNGETVNETLE _IOR('T', 221, int)
 
 /* TUNSETIFF ifr flags */
 #define IFF_TUN		0x0001
-- 
MST

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 5/5] if_tun: drop broken IFF_VNET_LE
       [not found] <1418732988-3535-1-git-send-email-mst@redhat.com>
  2014-12-16 13:05 ` [PATCH 2/5] if_tun: add TUNSETVNETLE/TUNGETVNETLE Michael S. Tsirkin
@ 2014-12-16 13:05 ` Michael S. Tsirkin
  1 sibling, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2014-12-16 13:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: David Miller, netdev, Dan Carpenter, linux-api, Jason Wang

Everyone should use TUNSETVNETLE/TUNGETVNETLE instead.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/uapi/linux/if_tun.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 274630c..50ae243 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -59,7 +59,6 @@
 #define IFF_ONE_QUEUE	0x2000
 #define IFF_VNET_HDR	0x4000
 #define IFF_TUN_EXCL	0x8000
-#define IFF_VNET_LE	0x10000
 #define IFF_MULTI_QUEUE 0x0100
 #define IFF_ATTACH_QUEUE 0x0200
 #define IFF_DETACH_QUEUE 0x0400
-- 
MST

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-16 13:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1418732988-3535-1-git-send-email-mst@redhat.com>
2014-12-16 13:05 ` [PATCH 2/5] if_tun: add TUNSETVNETLE/TUNGETVNETLE Michael S. Tsirkin
2014-12-16 13:05 ` [PATCH 5/5] if_tun: drop broken IFF_VNET_LE Michael S. Tsirkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).