diff options
author | David Ahern <dsahern@gmail.com> | 2018-04-17 17:33:21 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-17 23:41:17 -0400 |
commit | f8a1b43b709d8ef33a8de2f8f35095b4a4413713 (patch) | |
tree | 33d38a0628d1bf2925fe1b35620e9232236ab1a9 /net/ipv6/ndisc.c | |
parent | 3b6761d18bc11f2af2a6fc494e9026d39593f22c (diff) | |
download | op-kernel-dev-f8a1b43b709d8ef33a8de2f8f35095b4a4413713.zip op-kernel-dev-f8a1b43b709d8ef33a8de2f8f35095b4a4413713.tar.gz |
net/ipv6: Create a neigh_lookup for FIB entries
The router discovery code has a FIB entry and wants to validate the
gateway has a neighbor entry. Refactor the existing dst_neigh_lookup
for IPv6 and create a new function that takes the gateway and device
and returns a neighbor entry. Use the new function in
ndisc_router_discovery to validate the gateway.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r-- | net/ipv6/ndisc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index e4d9eea..5567171 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1276,7 +1276,9 @@ static void ndisc_router_discovery(struct sk_buff *skb) rt = rt6_get_dflt_router(net, &ipv6_hdr(skb)->saddr, skb->dev); if (rt) { - neigh = dst_neigh_lookup(&rt->dst, &ipv6_hdr(skb)->saddr); + neigh = ip6_neigh_lookup(&rt->fib6_nh.nh_gw, + rt->fib6_nh.nh_dev, NULL, + &ipv6_hdr(skb)->saddr); if (!neigh) { ND_PRINTK(0, err, "RA: %s got default router without neighbour\n", @@ -1304,7 +1306,9 @@ static void ndisc_router_discovery(struct sk_buff *skb) return; } - neigh = dst_neigh_lookup(&rt->dst, &ipv6_hdr(skb)->saddr); + neigh = ip6_neigh_lookup(&rt->fib6_nh.nh_gw, + rt->fib6_nh.nh_dev, NULL, + &ipv6_hdr(skb)->saddr); if (!neigh) { ND_PRINTK(0, err, "RA: %s got default router without neighbour\n", |