diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-31 09:39:56 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-07-31 09:39:56 +0200 |
| commit | fe3015748a905e08eb0e1750aa2928f520063d59 (patch) | |
| tree | d15524d1f7931e8e5964e9ff8368792d09282da5 /include/net/vxlan.h | |
| parent | 16aae4c64600a6319a6f10dbff833fa198bf9599 (diff) | |
| parent | 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4 (diff) | |
Merge 6.5-rc4 into tty-next
We need the serial/tty fixes in here as well for testing and future
development.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net/vxlan.h')
| -rw-r--r-- | include/net/vxlan.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index 0be91ca78d3a..1648240c9668 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h @@ -386,10 +386,15 @@ static inline netdev_features_t vxlan_features_check(struct sk_buff *skb, return features; } -/* IP header + UDP + VXLAN + Ethernet header */ -#define VXLAN_HEADROOM (20 + 8 + 8 + 14) -/* IPv6 header + UDP + VXLAN + Ethernet header */ -#define VXLAN6_HEADROOM (40 + 8 + 8 + 14) +static inline int vxlan_headroom(u32 flags) +{ + /* VXLAN: IP4/6 header + UDP + VXLAN + Ethernet header */ + /* VXLAN-GPE: IP4/6 header + UDP + VXLAN */ + return (flags & VXLAN_F_IPV6 ? sizeof(struct ipv6hdr) : + sizeof(struct iphdr)) + + sizeof(struct udphdr) + sizeof(struct vxlanhdr) + + (flags & VXLAN_F_GPE ? 0 : ETH_HLEN); +} static inline struct vxlanhdr *vxlan_hdr(struct sk_buff *skb) { |