summaryrefslogtreecommitdiffstats
path: root/include/net/vxlan.h
diff options
context:
space:
mode:
authorJiri Benc <jbenc@redhat.com>2016-02-16 21:58:57 +0100
committerDavid S. Miller <davem@davemloft.net>2016-02-17 23:52:11 -0500
commitd4ac05ff3697e036dcb0e2e284c5f7eb77cc0966 (patch)
tree3c9c9da05ad0aac7b3d2e82b4351444f3a826556 /include/net/vxlan.h
parentd8ef034730350f98c622eb7560dea28b258e9daf (diff)
downloadlinux-d4ac05ff3697e036dcb0e2e284c5f7eb77cc0966.tar.bz2
vxlan: introduce vxlan_hdr
Currently, pointer to the vxlan header is kept in a local variable. It has to be reloaded whenever the pskb pull operations are performed which usually happens somewhere deep in called functions. Create a vxlan_hdr function and use it to reference the vxlan header instead. Signed-off-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/vxlan.h')
-rw-r--r--include/net/vxlan.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index b314e4af89c5..3f38b40ec4aa 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -262,6 +262,11 @@ static inline netdev_features_t vxlan_features_check(struct sk_buff *skb,
/* IPv6 header + UDP + VXLAN + Ethernet header */
#define VXLAN6_HEADROOM (40 + 8 + 8 + 14)
+static inline struct vxlanhdr *vxlan_hdr(struct sk_buff *skb)
+{
+ return (struct vxlanhdr *)(udp_hdr(skb) + 1);
+}
+
#if IS_ENABLED(CONFIG_VXLAN)
void vxlan_get_rx_port(struct net_device *netdev);
#else