From 67dc832d152bbbaa6c3046eb68e876d2527beb9a Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 11 Nov 2010 01:14:05 +0000 Subject: [PATCH] [tcp] Set PSH flag only on packets containing data Suggested-by: Yelena Kadach Signed-off-by: Michael Brown --- src/net/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net/tcp.c b/src/net/tcp.c index 42064034..c3104771 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -522,7 +522,7 @@ static int tcp_xmit ( struct tcp_connection *tcp ) { tsopt->tsopt.tsval = htonl ( currticks() ); tsopt->tsopt.tsecr = htonl ( tcp->ts_recent ); } - if ( ! ( flags & TCP_SYN ) ) + if ( len != 0 ) flags |= TCP_PSH; tcphdr = iob_push ( iobuf, sizeof ( *tcphdr ) ); memset ( tcphdr, 0, sizeof ( *tcphdr ) );