File 0002-packet-deliver-VLAN-TPID-to-userspace.patch of Package linux-glibc-devel
From a0cdfcf39362410d5ea983f4daf67b38de129408 Mon Sep 17 00:00:00 2001
From: Atzm Watanabe <atzm@stratosphere.co.jp>
Date: Tue, 17 Dec 2013 22:53:40 +0900
Subject: [PATCH 2/2] packet: deliver VLAN TPID to userspace
Git-commit: a0cdfcf39362410d5ea983f4daf67b38de129408
Patch-mainline: v3.14-rc1
References: bnc#874131
This enables userspace to get VLAN TPID as well as the VLAN TCI.
Signed-off-by: Atzm Watanabe <atzm@stratosphere.co.jp>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Michal Marek <mmarek@suse.cz>
---
usr/include/linux/if_packet.h | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
--- linux-glibc-devel-3.12.orig/usr/include/linux/if_packet.h
+++ linux-glibc-devel-3.12/usr/include/linux/if_packet.h
@@ -83,17 +83,18 @@ struct tpacket_auxdata {
__u16 tp_mac;
__u16 tp_net;
__u16 tp_vlan_tci;
- __u16 tp_padding;
+ __u16 tp_vlan_tpid;
};
/* Rx ring - header status */
-#define TP_STATUS_KERNEL 0
-#define TP_STATUS_USER (1 << 0)
-#define TP_STATUS_COPY (1 << 1)
-#define TP_STATUS_LOSING (1 << 2)
-#define TP_STATUS_CSUMNOTREADY (1 << 3)
-#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
-#define TP_STATUS_BLK_TMO (1 << 5)
+#define TP_STATUS_KERNEL 0
+#define TP_STATUS_USER (1 << 0)
+#define TP_STATUS_COPY (1 << 1)
+#define TP_STATUS_LOSING (1 << 2)
+#define TP_STATUS_CSUMNOTREADY (1 << 3)
+#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
+#define TP_STATUS_BLK_TMO (1 << 5)
+#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */
/* Tx ring - header status */
#define TP_STATUS_AVAILABLE 0
@@ -132,12 +133,15 @@ struct tpacket2_hdr {
__u32 tp_sec;
__u32 tp_nsec;
__u16 tp_vlan_tci;
- __u8 tp_padding[6];
+ __u16 tp_vlan_tpid;
+ __u8 tp_padding[4];
};
struct tpacket_hdr_variant1 {
__u32 tp_rxhash;
__u32 tp_vlan_tci;
+ __u16 tp_vlan_tpid;
+ __u16 tp_padding;
};
struct tpacket3_hdr {
@@ -153,7 +157,7 @@ struct tpacket3_hdr {
union {
struct tpacket_hdr_variant1 hv1;
};
- __u8 tp_padding[12];
+ __u8 tp_padding[8];
};
struct tpacket_bd_ts {