summaryrefslogtreecommitdiffstats
path: root/src/net/udp/dhcp.c
diff options
context:
space:
mode:
authorMichael Brown2009-02-15 09:41:46 +0100
committerMichael Brown2009-02-15 09:44:22 +0100
commit8ae1cac0502c2a4d946f7bafa15a944bb1ef48a2 (patch)
treee271a28b9cb1ecb3749df8fc33e0d6f54eee8c8e /src/net/udp/dhcp.c
parent[umalloc] Avoid problems when _textdata_memsz is a multiple of 4kB (diff)
downloadipxe-8ae1cac0502c2a4d946f7bafa15a944bb1ef48a2.tar.gz
ipxe-8ae1cac0502c2a4d946f7bafa15a944bb1ef48a2.tar.xz
ipxe-8ae1cac0502c2a4d946f7bafa15a944bb1ef48a2.zip
[xfer] Make consistent assumptions that xfer metadata can never be NULL
The documentation in xfer.h and xfer.c does not say that the metadata parameter is optional in calls such as xfer_deliver_iob_meta() and the deliver_iob() method. However, some code in net/ is prepared to accept a NULL pointer, and xfer_deliver_as_iob() passes a NULL pointer directly to the deliver_iob() method. Fix this mess of conflicting assumptions by making everything assume that the metadata parameter is mandatory, and fixing xfer_deliver_as_iob() to pass in a dummy metadata structure (as is already done in xfer_deliver_iob()).
Diffstat (limited to 'src/net/udp/dhcp.c')
-rw-r--r--src/net/udp/dhcp.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c
index d1492146b..776635c2e 100644
--- a/src/net/udp/dhcp.c
+++ b/src/net/udp/dhcp.c
@@ -1052,12 +1052,6 @@ static int dhcp_deliver_iob ( struct xfer_interface *xfer,
int rc = 0;
/* Sanity checks */
- if ( ! meta ) {
- DBGC ( dhcp, "DHCP %p received packet without metadata\n",
- dhcp );
- rc = -EINVAL;
- goto err_no_meta;
- }
if ( ! meta->src ) {
DBGC ( dhcp, "DHCP %p received packet without source port\n",
dhcp );
@@ -1106,7 +1100,6 @@ static int dhcp_deliver_iob ( struct xfer_interface *xfer,
dhcppkt_put ( dhcppkt );
err_alloc_dhcppkt:
err_no_src:
- err_no_meta:
free_iob ( iobuf );
return rc;
}