aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 17b8c67998bb..62fcf3e48aca 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -463,6 +463,7 @@ int ip6_forward(struct sk_buff *skb)
463 */ 463 */
464 if (skb->dev == dst->dev && opt->srcrt == 0 && !skb_sec_path(skb)) { 464 if (skb->dev == dst->dev && opt->srcrt == 0 && !skb_sec_path(skb)) {
465 struct in6_addr *target = NULL; 465 struct in6_addr *target = NULL;
466 struct inet_peer *peer;
466 struct rt6_info *rt; 467 struct rt6_info *rt;
467 468
468 /* 469 /*
@@ -476,13 +477,12 @@ int ip6_forward(struct sk_buff *skb)
476 else 477 else
477 target = &hdr->daddr; 478 target = &hdr->daddr;
478 479
479 if (!rt->rt6i_peer) 480 peer = rt6_get_peer_create(rt);
480 rt6_bind_peer(rt, 1);
481 481
482 /* Limit redirects both by destination (here) 482 /* Limit redirects both by destination (here)
483 and by source (inside ndisc_send_redirect) 483 and by source (inside ndisc_send_redirect)
484 */ 484 */
485 if (inet_peer_xrlim_allow(rt->rt6i_peer, 1*HZ)) 485 if (inet_peer_xrlim_allow(peer, 1*HZ))
486 ndisc_send_redirect(skb, target); 486 ndisc_send_redirect(skb, target);
487 } else { 487 } else {
488 int addrtype = ipv6_addr_type(&hdr->saddr); 488 int addrtype = ipv6_addr_type(&hdr->saddr);
@@ -602,11 +602,8 @@ void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt)
602 int old, new; 602 int old, new;
603 603
604 if (rt && !(rt->dst.flags & DST_NOPEER)) { 604 if (rt && !(rt->dst.flags & DST_NOPEER)) {
605 struct inet_peer *peer; 605 struct inet_peer *peer = rt6_get_peer_create(rt);
606 606
607 if (!rt->rt6i_peer)
608 rt6_bind_peer(rt, 1);
609 peer = rt->rt6i_peer;
610 if (peer) { 607 if (peer) {
611 fhdr->identification = htonl(inet_getid(peer, 0)); 608 fhdr->identification = htonl(inet_getid(peer, 0));
612 return; 609 return;