diff mbox

tcp: do not forget FIN in tcp_shifted_skb()

Message ID 1380911146.3564.27.camel@edumazet-glaptop.roam.corp.google.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Eric Dumazet Oct. 4, 2013, 6:25 p.m. UTC
On Fri, 2013-10-04 at 21:03 +0300, Ilpo Järvinen wrote:

> Nice that it was finally found. For some reason my memory tries to say 
> that it wouldn't have not even tried to merge skbs with FIN but either
> I changed that at some point while deving or I just remember wrong.
> 
> Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> 

Thanks for reviewing.

It looks like I chose the opposite strategy in tcp_try_coalesce() :

Not allowing a merge if the FIN was set of the skb.

But really it seems we could have the merge.

I'll test the following before official submission.



--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index fa6cf1f..90cf0b3 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4119,9 +4119,6 @@  static bool tcp_try_coalesce(struct sock *sk,
 
 	*fragstolen = false;
 
-	if (tcp_hdr(from)->fin)
-		return false;
-
 	/* Its possible this segment overlaps with prior segment in queue */
 	if (TCP_SKB_CB(from)->seq != TCP_SKB_CB(to)->end_seq)
 		return false;
@@ -4134,6 +4131,10 @@  static bool tcp_try_coalesce(struct sock *sk,
 	NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPRCVCOALESCE);
 	TCP_SKB_CB(to)->end_seq = TCP_SKB_CB(from)->end_seq;
 	TCP_SKB_CB(to)->ack_seq = TCP_SKB_CB(from)->ack_seq;
+
+	if (tcp_hdr(from)->fin)
+		tcp_hdr(to)->fin = 1;
+
 	return true;
 }