aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-12 17:38:10 -0500
committerDavid S. Miller <davem@davemloft.net>2005-12-12 17:38:10 -0500
commitecc51b6d5ca04bb6346c9ad6b37d6ca8bace12b3 (patch)
tree4056dc6a739d43d052989ea39bb213e3a84392e0 /net/ipv6/tcp_ipv6.c
parent66e05225262cd9271fac13fe2fd1e9edb65e3978 (diff)
[TCPv6]: Fix skb leak
Spotted by Francois Romieu, thanks! Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 62c0e5bd931c..8827389abaf7 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -992,13 +992,12 @@ static void tcp_v6_send_reset(struct sk_buff *skb)
992 /* sk = NULL, but it is safe for now. RST socket required. */ 992 /* sk = NULL, but it is safe for now. RST socket required. */
993 if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { 993 if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
994 994
995 if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) 995 if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) {
996 ip6_xmit(NULL, buff, &fl, NULL, 0);
997 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
998 TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
996 return; 999 return;
997 1000 }
998 ip6_xmit(NULL, buff, &fl, NULL, 0);
999 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
1000 TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
1001 return;
1002 } 1001 }
1003 1002
1004 kfree_skb(buff); 1003 kfree_skb(buff);
@@ -1057,11 +1056,11 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32
1057 fl.fl_ip_sport = t1->source; 1056 fl.fl_ip_sport = t1->source;
1058 1057
1059 if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { 1058 if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) {
1060 if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) 1059 if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) {
1060 ip6_xmit(NULL, buff, &fl, NULL, 0);
1061 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
1061 return; 1062 return;
1062 ip6_xmit(NULL, buff, &fl, NULL, 0); 1063 }
1063 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
1064 return;
1065 } 1064 }
1066 1065
1067 kfree_skb(buff); 1066 kfree_skb(buff);