summaryrefslogtreecommitdiffstats
path: root/src/net/udp.c
diff options
context:
space:
mode:
authorMichael Brown2010-11-19 16:45:41 +0100
committerMichael Brown2010-11-19 17:08:05 +0100
commit5de4fba4f99e3dbb6da1d1d71aaf2a9d3f8b899f (patch)
tree4c35b5e17fa714620b518c6357335b285d03faed /src/net/udp.c
parent[netdevice] Add MAX_NET_HEADER_LEN and MAX_LL_NET_HEADER_LEN (diff)
downloadipxe-5de4fba4f99e3dbb6da1d1d71aaf2a9d3f8b899f.tar.gz
ipxe-5de4fba4f99e3dbb6da1d1d71aaf2a9d3f8b899f.tar.xz
ipxe-5de4fba4f99e3dbb6da1d1d71aaf2a9d3f8b899f.zip
[udp] Use MAX_LL_NET_HEADER_LEN instead of defining our own UDP_MAX_HLEN
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/net/udp.c')
-rw-r--r--src/net/udp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/net/udp.c b/src/net/udp.c
index 9bd80f3a..5f452535 100644
--- a/src/net/udp.c
+++ b/src/net/udp.c
@@ -9,6 +9,7 @@
#include <ipxe/xfer.h>
#include <ipxe/open.h>
#include <ipxe/uri.h>
+#include <ipxe/netdevice.h>
#include <ipxe/udp.h>
/** @file
@@ -197,7 +198,8 @@ static int udp_tx ( struct udp_connection *udp, struct io_buffer *iobuf,
int rc;
/* Check we can accommodate the header */
- if ( ( rc = iob_ensure_headroom ( iobuf, UDP_MAX_HLEN ) ) != 0 ) {
+ if ( ( rc = iob_ensure_headroom ( iobuf,
+ MAX_LL_NET_HEADER_LEN ) ) != 0 ) {
free_iob ( iobuf );
return rc;
}
@@ -361,13 +363,13 @@ static struct io_buffer * udp_xfer_alloc_iob ( struct udp_connection *udp,
size_t len ) {
struct io_buffer *iobuf;
- iobuf = alloc_iob ( UDP_MAX_HLEN + len );
+ iobuf = alloc_iob ( MAX_LL_NET_HEADER_LEN + len );
if ( ! iobuf ) {
DBGC ( udp, "UDP %p cannot allocate buffer of length %zd\n",
udp, len );
return NULL;
}
- iob_reserve ( iobuf, UDP_MAX_HLEN );
+ iob_reserve ( iobuf, MAX_LL_NET_HEADER_LEN );
return iobuf;
}