aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ndisc.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-10 06:58:16 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-11 01:40:11 -0400
commit1d861aa4b3fb08822055345f480850205ffe6170 (patch)
tree072c23dcde7766274464c75e51e820649301ad82 /net/ipv6/ndisc.c
parent16d1839907e695387654901995f9286b65fbbc6a (diff)
inet: Minimize use of cached route inetpeer.
Only use it in the absolutely required cases: 1) COW'ing metrics 2) ipv4 PMTU 3) ipv4 redirects Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r--net/ipv6/ndisc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 69a6330dea91..0fddd571400d 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1486,6 +1486,7 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
1486 int rd_len; 1486 int rd_len;
1487 int err; 1487 int err;
1488 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL; 1488 u8 ha_buf[MAX_ADDR_LEN], *ha = NULL;
1489 bool ret;
1489 1490
1490 if (ipv6_get_lladdr(dev, &saddr_buf, IFA_F_TENTATIVE)) { 1491 if (ipv6_get_lladdr(dev, &saddr_buf, IFA_F_TENTATIVE)) {
1491 ND_PRINTK(2, warn, "Redirect: no link-local address on %s\n", 1492 ND_PRINTK(2, warn, "Redirect: no link-local address on %s\n",
@@ -1519,8 +1520,11 @@ void ndisc_send_redirect(struct sk_buff *skb, const struct in6_addr *target)
1519 "Redirect: destination is not a neighbour\n"); 1520 "Redirect: destination is not a neighbour\n");
1520 goto release; 1521 goto release;
1521 } 1522 }
1522 peer = rt6_get_peer_create(rt); 1523 peer = inet_getpeer_v6(net->ipv6.peers, &rt->rt6i_dst.addr, 1);
1523 if (!inet_peer_xrlim_allow(peer, 1*HZ)) 1524 ret = inet_peer_xrlim_allow(peer, 1*HZ);
1525 if (peer)
1526 inet_putpeer(peer);
1527 if (!ret)
1524 goto release; 1528 goto release;
1525 1529
1526 if (dev->addr_len) { 1530 if (dev->addr_len) {