Skip to content

Commit

Permalink
geneve: maximum value of VNI cannot be used
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Girish Moodalbail authored and davem330 committed Aug 10, 2017
1 parent 50ddfba commit 04db70d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/geneve.c
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 04db70d

Please sign in to comment.