summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown2009-03-10 09:15:47 +0100
committerMichael Brown2009-03-10 09:15:47 +0100
commit3ed468e0c58bb0eb94925c18a0461cd5014b5777 (patch)
tree95969645c0b1b82845799796d4bd76dd678a368b
parent[time] Add the time command (diff)
downloadipxe-3ed468e0c58bb0eb94925c18a0461cd5014b5777.tar.gz
ipxe-3ed468e0c58bb0eb94925c18a0461cd5014b5777.tar.xz
ipxe-3ed468e0c58bb0eb94925c18a0461cd5014b5777.zip
[tcp] Avoid setting PSH flag when SYN flag is set
Some firewall devices seem to regard SYN,PSH as an invalid flag combination and reject the packet. Fix by setting PSH only if SYN is not set. Reported-by: DSE Incorporated <dseinc@gmail.com>
-rw-r--r--src/net/tcp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/net/tcp.c b/src/net/tcp.c
index 6bcd193c..0ef65779 100644
--- a/src/net/tcp.c
+++ b/src/net/tcp.c
@@ -471,6 +471,8 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
tsopt->tsopt.tsval = ntohl ( currticks() );
tsopt->tsopt.tsecr = ntohl ( tcp->ts_recent );
}
+ if ( ! ( flags & TCP_SYN ) )
+ flags |= TCP_PSH;
tcphdr = iob_push ( iobuf, sizeof ( *tcphdr ) );
memset ( tcphdr, 0, sizeof ( *tcphdr ) );
tcphdr->src = tcp->local_port;
@@ -478,7 +480,7 @@ static int tcp_xmit ( struct tcp_connection *tcp, int force_send ) {
tcphdr->seq = htonl ( tcp->snd_seq );
tcphdr->ack = htonl ( tcp->rcv_ack );
tcphdr->hlen = ( ( payload - iobuf->data ) << 2 );
- tcphdr->flags = ( flags | TCP_PSH );
+ tcphdr->flags = flags;
tcphdr->win = htons ( tcp->rcv_win );
tcphdr->csum = tcpip_chksum ( iobuf->data, iob_len ( iobuf ) );