summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2017-02-23 17:19:41 +0100
committerBen Hutchings <ben@decadent.org.uk>2017-06-05 21:17:16 +0100
commitc67e72d44634dcaf8cda07833c417faa8e37b837 (patch)
treed8a777ca279e69248bfb1d5a59e0a45c806136ea /drivers
parentebfe63171b30e2a1dd0d5075519949179b7ed019 (diff)
downloadlinux-stable-c67e72d44634dcaf8cda07833c417faa8e37b837.tar.gz
linux-stable-c67e72d44634dcaf8cda07833c417faa8e37b837.tar.bz2
linux-stable-c67e72d44634dcaf8cda07833c417faa8e37b837.zip
vxlan: correctly validate VXLAN ID against VXLAN_N_VID
commit 4e37d6911f36545b286d15073f6f2222f840e81c upstream. The incorrect check caused an off-by-one error: the maximum VID 0xffffff was unusable. Fixes: d342894c5d2f ("vxlan: virtual extensible lan") Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Acked-by: Jiri Benc <jbenc@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/vxlan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 7badf2aa3f61..34f510f78d63 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2326,7 +2326,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[])
if (data[IFLA_VXLAN_ID]) {
__u32 id = nla_get_u32(data[IFLA_VXLAN_ID]);
- if (id >= VXLAN_VID_MASK)
+ if (id >= VXLAN_N_VID)
return -ERANGE;
}