Skip to content

Commit

Permalink
ipv4: Handle ipv6 gateway in ipv4_confirm_neigh
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Ahern authored and David S. Miller committed Apr 8, 2019
1 parent 6f5f68d commit 6de9c05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 6de9c05

Please sign in to comment.