diff options
-rw-r--r-- | drivers/net/vxlan.c | 4 | ||||
-rw-r--r-- | include/net/vxlan.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 1e0a775ea882..f8528a4cf54f 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -1218,7 +1218,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) | |||
1218 | goto drop; | 1218 | goto drop; |
1219 | 1219 | ||
1220 | flags &= ~VXLAN_HF_RCO; | 1220 | flags &= ~VXLAN_HF_RCO; |
1221 | vni &= VXLAN_VID_MASK; | 1221 | vni &= VXLAN_VNI_MASK; |
1222 | } | 1222 | } |
1223 | 1223 | ||
1224 | /* For backwards compatibility, only allow reserved fields to be | 1224 | /* For backwards compatibility, only allow reserved fields to be |
@@ -1239,7 +1239,7 @@ static int vxlan_udp_encap_recv(struct sock *sk, struct sk_buff *skb) | |||
1239 | flags &= ~VXLAN_GBP_USED_BITS; | 1239 | flags &= ~VXLAN_GBP_USED_BITS; |
1240 | } | 1240 | } |
1241 | 1241 | ||
1242 | if (flags || (vni & ~VXLAN_VID_MASK)) { | 1242 | if (flags || vni & ~VXLAN_VNI_MASK) { |
1243 | /* If there are any unprocessed flags remaining treat | 1243 | /* If there are any unprocessed flags remaining treat |
1244 | * this as a malformed packet. This behavior diverges from | 1244 | * this as a malformed packet. This behavior diverges from |
1245 | * VXLAN RFC (RFC7348) which stipulates that bits in reserved | 1245 | * VXLAN RFC (RFC7348) which stipulates that bits in reserved |
diff --git a/include/net/vxlan.h b/include/net/vxlan.h index eabd3a038674..c73e7abbbaa5 100644 --- a/include/net/vxlan.h +++ b/include/net/vxlan.h | |||
@@ -91,6 +91,7 @@ struct vxlanhdr { | |||
91 | 91 | ||
92 | #define VXLAN_N_VID (1u << 24) | 92 | #define VXLAN_N_VID (1u << 24) |
93 | #define VXLAN_VID_MASK (VXLAN_N_VID - 1) | 93 | #define VXLAN_VID_MASK (VXLAN_N_VID - 1) |
94 | #define VXLAN_VNI_MASK (VXLAN_VID_MASK << 8) | ||
94 | #define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr)) | 95 | #define VXLAN_HLEN (sizeof(struct udphdr) + sizeof(struct vxlanhdr)) |
95 | 96 | ||
96 | struct vxlan_metadata { | 97 | struct vxlan_metadata { |