Skip to contentSkip to conversation

reference count cleanup continued -IPv6

PATCH Applied Nivedita Singhvi 2 participants 2 messages Mar 31, 2004 – Apr 1, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reference count cleanup continued -IPv6

Continuing the reference count clean up, this time in tcp_v6_rcv(). We should not be doing a sock_put() on a socket in TIMEWAIT state.

Applies to 2.6.4. Should apply to current bits as
well.

thanks,
Nivedita

net/ipv6/tcp_ipv6.c +6 -4
diff -urN linux-2.6.4/net/ipv6/tcp_ipv6.c linux-2.6.4mc6/net/ipv6/tcp_ipv6.c
@@ -1639,7 +1639,7 @@
 
  no_tcp_socket:
  	if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
-		goto discard_and_relse;
+		goto discard_it;
 
  	if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
  bad_packet:
@@ -1662,12 +1662,14 @@
  	goto discard_it;
 
  do_time_wait:
-	if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
-		goto discard_and_relse;
+	if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
+		tcp_tw_put((struct tcp_tw_bucket *) sk);
+		goto discard_it;
+	}
 
  	if (skb->len < (th->doff<<2) || tcp_checksum_complete(skb)) {
  		TCP_INC_STATS_BH(TcpInErrs);
-		sock_put(sk);
+		tcp_tw_put((struct tcp_tw_bucket *) sk);	
  		goto discard_it;
  	}
#1 lore raw
Quoted 6 lines · On Wed, 31 Mar 2004 07:33:00 -0800 Nivedita Singhvi <[email protected]> wrote:

Continuing the reference count clean up, this time in tcp_v6_rcv(). We should not be doing a sock_put() on a socket in TIMEWAIT state.

Applies to 2.6.4. Should apply to current bits as
well.

Applied, thanks Nivedita.

I've also coded up a 2.4.x variant, but you can feel free to do this for me in the future :-)