ipv6: Fix tcp_v6_send_response(): it didn't set skb transport header
Subsystems (3)
PATCH 1/1 ipv6: Fix tcp_v6_send_response(): it didn't set skb transport header
Hello,
Here is a patch which fixes an issue observed when using TCP over IPv6 and AH from IPsec.
When a connection gets closed the 4-way method and the last ACK from the server gets dropped, the subsequent FINs from the client do not get ACKed because tcp_v6_send_response does not set the transport header pointer. This causes ah6_output to try to allocate a lot of memory, which typically fails, so the ACKs never make it out of the stack.
I have reproduced the problem on kernel 2.6.7, but after looking at the latest kernel it seems the problem is still there.
Cosmin.
--- net/ipv6/tcp_ipv6.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv6/tcp_ipv6.c +1 -0
@@ -1003,6 +1003,7 @@ static void tcp_v6_send_response(struct sk_buff *skb, u32 seq, u32 ack, u32 win,skb_reserve (buff,MAX_HEADER +sizeof (struct ipv6hdr ) + tot_len); t1 = (struct tcphdr *)skb_push (buff, tot_len); +skb_reset_transport_header (skb);/* Swap the send and the receive. */ memset (t1,0 ,sizeof (*t1));
From: Cosmin Ratiu <[email protected]>
Date: Thu, 3 Sep 2009 19:25:53 +0300
Quoted 11 lines
Hello,
Here is a patch which fixes an issue observed when using TCP over IPv6 and AH from IPsec.
When a connection gets closed the 4-way method and the last ACK from the server gets dropped, the subsequent FINs from the client do not get ACKed because
tcp_v6_send_responsedoes not set the transport header pointer. This causesah6_outputto try to allocate a lot of memory, which typically fails, so the ACKs never make it out of the stack.
Quoted 4 lines
I have reproduced the problem on kernel 2.6.7, but after looking at the latest kernel it seems the problem is still there.
Signed-off-by Cosmin Ratiu <[email protected]>
Great catch. IPV4 handles this transparently via ip_append_data() which is what it uses to send these kinds of frames. IPV6 does this stuff by hand.
Applied to net-next-2.6, thanks!