[ovs-dev] [PATCH net-next 7/7] vxlan: export vxlan header length.

Pravin B Shelar pshelar at nicira.com
Sat Mar 30 16:18:44 UTC 2013


openvswitch needs vxlan header len.

Signed-off-by: Pravin B Shelar <pshelar at nicira.com>
---
 drivers/net/vxlan.c |    6 ------
 include/net/vxlan.h |    8 ++++++++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 11c1f69..3fc999e 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -60,12 +60,6 @@
 
 #define VXLAN_FLAGS 0x08000000	/* struct vxlanhdr.vx_flags required value. */
 
-/* VXLAN protocol header */
-struct vxlanhdr {
-	__be32 vx_flags;
-	__be32 vx_vni;
-};
-
 /* UDP port for VXLAN traffic. */
 static unsigned int vxlan_portno __read_mostly = 8472;
 module_param_named(udp_port, vxlan_portno, uint, 0444);
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 237ccff..6515929 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -5,6 +5,14 @@
 #include <linux/netdevice.h>
 #include <linux/udp.h>
 
+/* VXLAN protocol header */
+struct vxlanhdr {
+	__be32 vx_flags;
+	__be32 vx_vni;
+};
+
+#define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr))
+
 struct vxlan_port {
 	int (*vx_rcv)(struct vxlan_port *port, struct sk_buff *skb, __be32 key);
 	void *user_data;
-- 
1.7.1




More information about the dev mailing list