diff options
author | David Ahern <dsahern@gmail.com> | 2019-06-08 14:53:27 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-10 10:44:56 -0700 |
commit | 2c170e075375f7421a8007d3993f55f3eb89760b (patch) | |
tree | f1b9007a86200e92feaf4dcfd29aa921f3ddc15c /net/ipv6 | |
parent | a1b7a1f06c78390e912692c0da40f4234ee83a4f (diff) | |
download | linux-2c170e075375f7421a8007d3993f55f3eb89760b.tar.bz2 |
ipv6: Handle all fib6_nh in a nexthop in fib6_info_uses_dev
Add a hook in fib6_info_uses_dev to handle nexthop struct in a fib6_info.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/route.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d1139ef077cd..d56e1ff49e47 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -5190,9 +5190,27 @@ nla_put_failure: return -EMSGSIZE; } +static int fib6_info_nh_uses_dev(struct fib6_nh *nh, void *arg) +{ + const struct net_device *dev = arg; + + if (nh->fib_nh_dev == dev) + return 1; + + return 0; +} + static bool fib6_info_uses_dev(const struct fib6_info *f6i, const struct net_device *dev) { + if (f6i->nh) { + struct net_device *_dev = (struct net_device *)dev; + + return !!nexthop_for_each_fib6_nh(f6i->nh, + fib6_info_nh_uses_dev, + _dev); + } + if (f6i->fib6_nh->fib_nh_dev == dev) return true; |