aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ndisc.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2005-09-08 18:11:55 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-08 18:11:55 -0400
commite104411b82f5c4d19752c335492036abdbf5880d (patch)
tree03f26f98685689ab6bfa47d5bdbb6730f64bfadb /net/ipv6/ndisc.c
parentcf0b450cd5176b68ac7d5bbe68aeae6bb6a5a4b8 (diff)
[XFRM]: Always release dst_entry on error in xfrm_lookup
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ndisc.c')
-rw-r--r--net/ipv6/ndisc.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index a7eae30f4554..555a31347eda 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -447,10 +447,8 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
447 return; 447 return;
448 448
449 err = xfrm_lookup(&dst, &fl, NULL, 0); 449 err = xfrm_lookup(&dst, &fl, NULL, 0);
450 if (err < 0) { 450 if (err < 0)
451 dst_release(dst);
452 return; 451 return;
453 }
454 452
455 if (inc_opt) { 453 if (inc_opt) {
456 if (dev->addr_len) 454 if (dev->addr_len)
@@ -539,10 +537,8 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
539 return; 537 return;
540 538
541 err = xfrm_lookup(&dst, &fl, NULL, 0); 539 err = xfrm_lookup(&dst, &fl, NULL, 0);
542 if (err < 0) { 540 if (err < 0)
543 dst_release(dst);
544 return; 541 return;
545 }
546 542
547 len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr); 543 len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
548 send_llinfo = dev->addr_len && !ipv6_addr_any(saddr); 544 send_llinfo = dev->addr_len && !ipv6_addr_any(saddr);
@@ -616,10 +612,8 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
616 return; 612 return;
617 613
618 err = xfrm_lookup(&dst, &fl, NULL, 0); 614 err = xfrm_lookup(&dst, &fl, NULL, 0);
619 if (err < 0) { 615 if (err < 0)
620 dst_release(dst);
621 return; 616 return;
622 }
623 617
624 len = sizeof(struct icmp6hdr); 618 len = sizeof(struct icmp6hdr);
625 if (dev->addr_len) 619 if (dev->addr_len)
@@ -1353,10 +1347,8 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1353 return; 1347 return;
1354 1348
1355 err = xfrm_lookup(&dst, &fl, NULL, 0); 1349 err = xfrm_lookup(&dst, &fl, NULL, 0);
1356 if (err) { 1350 if (err)
1357 dst_release(dst);
1358 return; 1351 return;
1359 }
1360 1352
1361 rt = (struct rt6_info *) dst; 1353 rt = (struct rt6_info *) dst;
1362 1354