diff options
author | David Ahern <dsahern@gmail.com> | 2019-04-06 01:30:36 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-09 00:22:41 +0200 |
commit | 6de9c0557e4fc7e1b2f8ed6178aad32f64e1d7da (patch) | |
tree | 9b0fcf8e1ffe9eb38d37b7661347e8bed28128e6 /net/ipv4/route.c | |
parent | bpf: Handle ipv6 gateway in bpf_ipv4_fib_lookup (diff) | |
download | linux-6de9c0557e4fc7e1b2f8ed6178aad32f64e1d7da.tar.xz linux-6de9c0557e4fc7e1b2f8ed6178aad32f64e1d7da.zip |
ipv4: Handle ipv6 gateway in ipv4_confirm_neigh
Update ipv4_confirm_neigh to handle an ipv6 gateway.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 32ecb4c1c7e3..efa6a36cbfff 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -465,13 +465,15 @@ static void ipv4_confirm_neigh(const struct dst_entry *dst, const void *daddr) struct net_device *dev = dst->dev; const __be32 *pkey = daddr; - if (rt->rt_gw_family == AF_INET) + if (rt->rt_gw_family == AF_INET) { pkey = (const __be32 *)&rt->rt_gw4; - else if (!daddr || + } else if (rt->rt_gw_family == AF_INET6) { + return __ipv6_confirm_neigh_stub(dev, &rt->rt_gw6); + } else if (!daddr || (rt->rt_flags & - (RTCF_MULTICAST | RTCF_BROADCAST | RTCF_LOCAL))) + (RTCF_MULTICAST | RTCF_BROADCAST | RTCF_LOCAL))) { return; - + } __ipv4_confirm_neigh(dev, *(__force u32 *)pkey); } |