diff options
author | Michael Brown | 2010-11-19 16:50:02 +0100 |
---|---|---|
committer | Michael Brown | 2010-11-19 17:08:05 +0100 |
commit | d012f8701887526498b3dc9917b467c6319c7073 (patch) | |
tree | fa2f3054c2e092bf49b2a5aeed277c9155c5b41f /src/net/tcp.c | |
parent | [udp] Remove obsolete constants (diff) | |
download | ipxe-d012f8701887526498b3dc9917b467c6319c7073.tar.gz ipxe-d012f8701887526498b3dc9917b467c6319c7073.tar.xz ipxe-d012f8701887526498b3dc9917b467c6319c7073.zip |
[tcp] Use MAX_LL_NET_HEADER_LEN instead of defining our own MAX_HDR_LEN
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/tcp.c')
-rw-r--r-- | src/net/tcp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/net/tcp.c b/src/net/tcp.c index c3104771..3e1aeedc 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -12,6 +12,7 @@ #include <ipxe/xfer.h> #include <ipxe/open.h> #include <ipxe/uri.h> +#include <ipxe/netdevice.h> #include <ipxe/tcpip.h> #include <ipxe/tcp.h> @@ -483,14 +484,14 @@ static int tcp_xmit ( struct tcp_connection *tcp ) { start_timer ( &tcp->timer ); /* Allocate I/O buffer */ - iobuf = alloc_iob ( len + MAX_HDR_LEN ); + iobuf = alloc_iob ( len + MAX_LL_NET_HEADER_LEN ); if ( ! iobuf ) { DBGC ( tcp, "TCP %p could not allocate iobuf for %08x..%08x " "%08x\n", tcp, tcp->snd_seq, ( tcp->snd_seq + seq_len ), tcp->rcv_ack ); return -ENOMEM; } - iob_reserve ( iobuf, MAX_HDR_LEN ); + iob_reserve ( iobuf, MAX_LL_NET_HEADER_LEN ); /* Fill data payload from transmit queue */ tcp_process_tx_queue ( tcp, len, iobuf, 0 ); @@ -627,14 +628,14 @@ static int tcp_xmit_reset ( struct tcp_connection *tcp, int rc; /* Allocate space for dataless TX buffer */ - iobuf = alloc_iob ( MAX_HDR_LEN ); + iobuf = alloc_iob ( MAX_LL_NET_HEADER_LEN ); if ( ! iobuf ) { DBGC ( tcp, "TCP %p could not allocate iobuf for RST " "%08x..%08x %08x\n", tcp, ntohl ( in_tcphdr->ack ), ntohl ( in_tcphdr->ack ), ntohl ( in_tcphdr->seq ) ); return -ENOMEM; } - iob_reserve ( iobuf, MAX_HDR_LEN ); + iob_reserve ( iobuf, MAX_LL_NET_HEADER_LEN ); /* Construct RST response */ tcphdr = iob_push ( iobuf, sizeof ( *tcphdr ) ); |