Commit 6de9c055 authored by David Ahern's avatar David Ahern Committed by David S. Miller

ipv4: Handle ipv6 gateway in ipv4_confirm_neigh

Update ipv4_confirm_neigh to handle an ipv6 gateway.
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6f5f68d0
...@@ -465,13 +465,15 @@ static void ipv4_confirm_neigh(const struct dst_entry *dst, const void *daddr) ...@@ -465,13 +465,15 @@ static void ipv4_confirm_neigh(const struct dst_entry *dst, const void *daddr)
struct net_device *dev = dst->dev; struct net_device *dev = dst->dev;
const __be32 *pkey = daddr; const __be32 *pkey = daddr;
if (rt->rt_gw_family == AF_INET) if (rt->rt_gw_family == AF_INET) {
pkey = (const __be32 *)&rt->rt_gw4; 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 & (rt->rt_flags &
(RTCF_MULTICAST | RTCF_BROADCAST | RTCF_LOCAL))) (RTCF_MULTICAST | RTCF_BROADCAST | RTCF_LOCAL))) {
return; return;
}
__ipv4_confirm_neigh(dev, *(__force u32 *)pkey); __ipv4_confirm_neigh(dev, *(__force u32 *)pkey);
} }
......
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