aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxlan.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@kernel.org>2020-06-09 17:27:28 -0600
committerDavid S. Miller <davem@davemloft.net>2020-06-10 13:20:20 -0700
commit50cb8769f2c1c657a470bda192b79ff679d0ecfc (patch)
tree66ec6fd0db288e9d3e98a48446eff9d893968f95 /drivers/net/vxlan.c
parentnexthop: Fix fdb labeling for groups (diff)
downloadlinux-dev-50cb8769f2c1c657a470bda192b79ff679d0ecfc.tar.xz
linux-dev-50cb8769f2c1c657a470bda192b79ff679d0ecfc.zip
vxlan: Remove access to nexthop group struct
vxlan driver should be using helpers to access nexthop struct internals. Remove open check if whether nexthop is multipath in favor of the existing nexthop_is_multipath helper. Add a new helper, nexthop_has_v4, to cover the need to check has_v4 in a group. Fixes: 1274e1cc4226 ("vxlan: ecmp support for mac fdb entries") Cc: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David Ahern <dsahern@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxlan.c')
-rw-r--r--drivers/net/vxlan.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 8a39e8047f14..e8085ab6d484 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -857,7 +857,6 @@ static int vxlan_fdb_nh_update(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
u32 nhid, struct netlink_ext_ack *extack)
{
struct nexthop *old_nh = rtnl_dereference(fdb->nh);
- struct nh_group *nhg;
struct nexthop *nh;
int err = -EINVAL;
@@ -881,8 +880,7 @@ static int vxlan_fdb_nh_update(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
goto err_inval;
}
- nhg = rtnl_dereference(nh->nh_grp);
- if (!nh->is_group || !nhg->mpath) {
+ if (!nexthop_is_multipath(nh)) {
NL_SET_ERR_MSG(extack, "Nexthop is not a multipath group");
goto err_inval;
}
@@ -890,14 +888,14 @@ static int vxlan_fdb_nh_update(struct vxlan_dev *vxlan, struct vxlan_fdb *fdb,
/* check nexthop group family */
switch (vxlan->default_dst.remote_ip.sa.sa_family) {
case AF_INET:
- if (!nhg->has_v4) {
+ if (!nexthop_has_v4(nh)) {
err = -EAFNOSUPPORT;
NL_SET_ERR_MSG(extack, "Nexthop group family not supported");
goto err_inval;
}
break;
case AF_INET6:
- if (nhg->has_v4) {
+ if (nexthop_has_v4(nh)) {
err = -EAFNOSUPPORT;
NL_SET_ERR_MSG(extack, "Nexthop group family not supported");
goto err_inval;