Skip to content

Commit 72b4868

Browse files
roopa-prabhudavem330
authored andcommitted
vxlan: add check to prevent use of remote ip attributes with NDA_NH_ID
NDA_NH_ID represents a remote ip or a group of remote ips. It allows use of nexthop groups in lieu of a remote ip or a list of remote ips supported by the fdb api. Current code ignores the other remote ip attrs when NDA_NH_ID is specified. In the spirit of strict checking, This commit adds a check to explicitly return an error on incorrect usage. Fixes: 1274e1c ("vxlan: ecmp support for mac fdb entries") Signed-off-by: Roopa Prabhu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d9f0d66 commit 72b4868

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/net/vxlan.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,10 @@ static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,
11961196
struct net *net = dev_net(vxlan->dev);
11971197
int err;
11981198

1199+
if (tb[NDA_NH_ID] && (tb[NDA_DST] || tb[NDA_VNI] || tb[NDA_IFINDEX] ||
1200+
tb[NDA_PORT]))
1201+
return -EINVAL;
1202+
11991203
if (tb[NDA_DST]) {
12001204
err = vxlan_nla_get_addr(ip, tb[NDA_DST]);
12011205
if (err)

0 commit comments

Comments
 (0)