aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ndisc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-09 02:24:18 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-09 02:24:18 -0400
commitfbfe95a42e90b3dd079cc9019ba7d7700feee0f6 (patch)
treef5f16e6efcf1411a47df8b836f669fc452489dd4 /net/ipv6/ndisc.c
parent7123aaa3a1416529ce461e98108e6b343b294643 (diff)
inet: Create and use rt{,6}_get_peer_create().
There's a lot of places that open-code rt{,6}_get_peer() only because they want to set 'create' to one. So add an rt{,6}_get_peer_create() for their sake. There were also a few spots open-coding plain rt{,6}_get_peer() and those are transformed here as well. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r--net/ipv6/ndisc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 54f62d3b8dd6..69a6330dea91 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1472,6 +1472,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
1472 struct net *net = dev_net(dev); 1472 struct net *net = dev_net(dev);
1473 struct sock *sk = net->ipv6.ndisc_sk; 1473 struct sock *sk = net->ipv6.ndisc_sk;
1474 int len = sizeof(struct icmp6hdr) + 2 * sizeof(struct in6_addr); 1474 int len = sizeof(struct icmp6hdr) + 2 * sizeof(struct in6_addr);
1475 struct inet_peer *peer;
1475 struct sk_buff *buff; 1476 struct sk_buff *buff;
1476 struct icmp6hdr *icmph; 1477 struct icmp6hdr *icmph;
1477 struct in6_addr saddr_buf; 1478 struct in6_addr saddr_buf;
@@ -1518,9 +1519,8 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
1518 "Redirect: destination is not a neighbour\n"); 1519 "Redirect: destination is not a neighbour\n");
1519 goto release; 1520 goto release;
1520 } 1521 }
1521 if (!rt->rt6i_peer) 1522 peer = rt6_get_peer_create(rt);
1522 rt6_bind_peer(rt, 1); 1523 if (!inet_peer_xrlim_allow(peer, 1*HZ))
1523 if (!inet_peer_xrlim_allow(rt->rt6i_peer, 1*HZ))
1524 goto release; 1524 goto release;
1525 1525
1526 if (dev->addr_len) { 1526 if (dev->addr_len) {