Commit 03eaeda7 authored by Roopa Prabhu's avatar Roopa Prabhu Committed by David S. Miller

vxlan: fix dereference of nexthop group in nexthop update path

fix dereference of nexthop group in fdb nexthop group
update validation path.

Fixes: 1274e1cc ("vxlan: ecmp support for mac fdb entries")
Reported-by: default avatarIdo Schimmel <idosch@idosch.org>
Suggested-by: default avatarIdo Schimmel <idosch@idosch.org>
Signed-off-by: default avatarRoopa Prabhu <roopa@cumulusnetworks.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 547ce4cf
......@@ -881,13 +881,13 @@ static int vxlan_fdb_nh_update(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
goto err_inval;
}
if (!nh->is_group || !nh->nh_grp->mpath) {
nhg = rtnl_dereference(nh->nh_grp);
if (!nh->is_group || !nhg->mpath) {
NL_SET_ERR_MSG(extack, "Nexthop is not a multipath group");
goto err_inval;
}
/* check nexthop group family */
nhg = rtnl_dereference(nh->nh_grp);
switch (vxlan->default_dst.remote_ip.sa.sa_family) {
case AF_INET:
if (!nhg->has_v4) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment