diff options
author | Michael Brown <mcb30@ipxe.org> | 2011-09-19 15:48:57 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2011-09-19 15:52:54 +0100 |
commit | 469bd11f392797027b68e9d22f8f59a547886515 (patch) | |
tree | 9a8de4cf54eae0e2cc1d85d4561a6c9121e004e8 /src/include/ipxe/tcp.h | |
parent | 1691cf50bc1d825cb9dac52e53b5280481fa0acf (diff) | |
download | ipxe-469bd11f392797027b68e9d22f8f59a547886515.tar.gz |
[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>
Diffstat (limited to 'src/include/ipxe/tcp.h')
-rw-r--r-- | src/include/ipxe/tcp.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/include/ipxe/tcp.h b/src/include/ipxe/tcp.h index 197712b11..7084af60e 100644 --- a/src/include/ipxe/tcp.h +++ b/src/include/ipxe/tcp.h @@ -309,6 +309,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 * * @v seq1 Sequence number 1 |