[tcp] Allow sufficient headroom for TCP headers

TCP currently neglects to allow sufficient space for its own headers
when allocating I/O buffers.  This problem is masked by the fact that
the maximum link-layer header size (802.11) is substantially larger
than the common Ethernet link-layer header.

Fix by allowing sufficient space for any TCP headers, as well as the
network-layer and link-layer headers.

Reported-by: Scott K Logan <logans@cottsay.net>
Debugged-by: Scott K Logan <logans@cottsay.net>
Tested-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2011-09-19 15:48:57 +01:00
parent 1691cf50bc
commit 469bd11f39
2 changed files with 14 additions and 4 deletions

View File

@@ -308,6 +308,16 @@ struct tcp_options {
*/
#define TCP_MSL ( 2 * 60 * TICKS_PER_SEC )
/**
* TCP maximum header length
*
*/
#define TCP_MAX_HEADER_LEN \
( MAX_LL_NET_HEADER_LEN + \
sizeof ( struct tcp_header ) + \
sizeof ( struct tcp_mss_option ) + \
sizeof ( struct tcp_timestamp_padded_option ) )
/**
* Compare TCP sequence numbers
*