diff options
Diffstat (limited to 'net/ipv6/route.c')
-rw-r--r-- | net/ipv6/route.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d9ba4808f26a..58a3ec23da2f 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -313,10 +313,12 @@ void rt6_bind_peer(struct rt6_info *rt, int create) | |||
313 | return; | 313 | return; |
314 | 314 | ||
315 | peer = inet_getpeer_v6(base, &rt->rt6i_dst.addr, create); | 315 | peer = inet_getpeer_v6(base, &rt->rt6i_dst.addr, create); |
316 | if (!rt6_set_peer(rt, peer)) | 316 | if (peer) { |
317 | inet_putpeer(peer); | 317 | if (!rt6_set_peer(rt, peer)) |
318 | else | 318 | inet_putpeer(peer); |
319 | rt->rt6i_peer_genid = rt6_peer_genid(); | 319 | else |
320 | rt->rt6i_peer_genid = rt6_peer_genid(); | ||
321 | } | ||
320 | } | 322 | } |
321 | 323 | ||
322 | static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, | 324 | static void ip6_dst_ifdown(struct dst_entry *dst, struct net_device *dev, |