Hi David, Please consider pulling from:
master.kernel.org:/pub/scm/linux/kernel/git/acme/net-2.6.16.git Best Regards, - Arnaldo
tree 402c2b51d32d31f999fed91365c509d1fbd355c7 parent 9b0c0171dae84125f43b6ca80f9108768863df97 author Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1134349890 -0200 committer Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> 1134349890 -0200 [TCPv6]: Fix skb leak Spotted by Francois Romieu, thanks! The DCCP case was fixed as well in another patch. Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]> ------------------------------------------------------------------------------ tcp_ipv6.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) ------------------------------------------------------------------------------ diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 7a077de..514b57b 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -779,13 +779,12 @@ static void tcp_v6_send_reset(struct sk_ /* sk = NULL, but it is safe for now. RST socket required. */ if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) + if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { + ip6_xmit(NULL, buff, &fl, NULL, 0); + TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); + TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); return; - - ip6_xmit(NULL, buff, &fl, NULL, 0); - TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); - TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); - return; + } } kfree_skb(buff); @@ -844,11 +843,11 @@ static void tcp_v6_send_ack(struct sk_bu fl.fl_ip_sport = t1->source; if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) + if (xfrm_lookup(&buff->dst, &fl, NULL, 0) >= 0) { + ip6_xmit(NULL, buff, &fl, NULL, 0); + TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); return; - ip6_xmit(NULL, buff, &fl, NULL, 0); - TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); - return; + } } kfree_skb(buff);