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>
This commit is contained in:

committed by
David S. Miller

parent
d8ef034730
commit
d4ac05ff36
@@ -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
|
||||
|
Reference in New Issue
Block a user