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 | |
| 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>
| -rw-r--r-- | src/include/ipxe/tcp.h | 1 | ||||
| -rw-r--r-- | src/net/tcp.c | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/include/ipxe/tcp.h b/src/include/ipxe/tcp.h index e64614646..68bb899ae 100644 --- a/src/include/ipxe/tcp.h +++ b/src/include/ipxe/tcp.h @@ -258,7 +258,6 @@ struct tcp_options { #define TCP_MIN_PORT 1 /* Some IOB constants */ -#define MAX_HDR_LEN 100 #define MAX_IOB_LEN 1500 #define MIN_IOB_LEN MAX_HDR_LEN + 100 /* To account for padding by LL */ diff --git a/src/net/tcp.c b/src/net/tcp.c index c31047712..3e1aeedc7 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 ) ); |
