aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6b95f74..0428b64 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1374,6 +1374,7 @@ static int check_peer_redir(struct dst_entry *dst, struct inet_peer *peer)
struct rtable *rt = (struct rtable *) dst;
__be32 orig_gw = rt->rt_gateway;
struct neighbour *n, *old_n;
+ struct hh_cache *old_hh;
dst_confirm(&rt->dst);
@@ -1381,6 +1382,9 @@ static int check_peer_redir(struct dst_entry *dst, struct inet_peer *peer)
n = __arp_bind_neighbour(&rt->dst, rt->rt_gateway);
if (IS_ERR(n))
return PTR_ERR(n);
+ old_hh = xchg(&rt->dst.hh, NULL);
+ if (old_hh)
+ hh_cache_put(old_hh);
old_n = xchg(&rt->dst._neighbour, n);
if (old_n)
neigh_release(old_n);
@@ -3450,7 +3454,7 @@ int __init ip_rt_init(void)
xfrm_init();
xfrm4_init(ip_rt_max_size);
#endif
- rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL);
+ rtnl_register(PF_INET, RTM_GETROUTE, inet_rtm_getroute, NULL, NULL);
#ifdef CONFIG_SYSCTL
register_pernet_subsys(&sysctl_route_ops);