summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGirish Moodalbail <girish.moodalbail@oracle.com>2017-08-08 17:26:24 -0700
committerDavid S. Miller <davem@davemloft.net>2017-08-09 22:41:04 -0700
commit04db70d9fe7019d96118158fbaaccb4959ba2bd4 (patch)
tree079dc7bc10a82f031ba3212dd68ff05bbae2b35d
parent50ddfbafcd1e1f95185dfaa4ad794f742b0beaf8 (diff)
downloadlinux-04db70d9fe7019d96118158fbaaccb4959ba2bd4.tar.bz2
geneve: maximum value of VNI cannot be used
Geneve's Virtual Network Identifier (VNI) is 24 bit long, so the range of values for it would be from 0 to 16777215 (2^24 -1). However, one cannot create a geneve device with VNI set to 16777215. This patch fixes this issue. Signed-off-by: Girish Moodalbail <girish.moodalbail@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/geneve.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index de8156c6b292..2bbda71818ad 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -1091,7 +1091,7 @@ static int geneve_validate(struct nlattr *tb[], struct nlattr *data[],
if (data[IFLA_GENEVE_ID]) {
__u32 vni = nla_get_u32(data[IFLA_GENEVE_ID]);
- if (vni >= GENEVE_VID_MASK)
+ if (vni >= GENEVE_N_VID)
return -ERANGE;
}