summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2006-07-20 02:18:50 +0200
committerMichael Brown2006-07-20 02:18:50 +0200
commit9ad5cede963837d23e55fb4c80c3036db21e248d (patch)
treeadfa606a81b7de982f5d3abd1361cc3254472c18 /src
parentPackets without a DHCP_MESSAGE_TYPE option are probably just BOOTP (diff)
downloadipxe-9ad5cede963837d23e55fb4c80c3036db21e248d.tar.gz
ipxe-9ad5cede963837d23e55fb4c80c3036db21e248d.tar.xz
ipxe-9ad5cede963837d23e55fb4c80c3036db21e248d.zip
Set DHCP_MESSAGE_TYPE option within the main options block. This
doesn't seem to be required by the RFCs, but at least ISC dhcpd and ethereal refuse to recognise it otherwise.
Diffstat (limited to 'src')
-rw-r--r--src/net/udp/dhcp.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c
index a0738b740..bbb4a1a7a 100644
--- a/src/net/udp/dhcp.c
+++ b/src/net/udp/dhcp.c
@@ -232,7 +232,6 @@ static int create_dhcp_packet ( struct dhcp_session *dhcp, uint8_t msgtype,
struct dhcphdr *dhcphdr = data;
static const uint8_t overloading = ( DHCP_OPTION_OVERLOAD_FILE |
DHCP_OPTION_OVERLOAD_SNAME );
- int rc;
/* Sanity check */
if ( max_len < sizeof ( *dhcphdr ) )
@@ -264,11 +263,14 @@ static int create_dhcp_packet ( struct dhcp_session *dhcp, uint8_t msgtype,
sizeof ( overloading ) ) == NULL )
return -ENOSPC;
- /* Set DHCP_MESSAGE_TYPE option */
- if ( ( rc = set_dhcp_packet_option ( dhcppkt, DHCP_MESSAGE_TYPE,
- &msgtype,
- sizeof ( msgtype ) ) ) != 0 )
- return rc;
+ /* Set DHCP_MESSAGE_TYPE option within the main options block.
+ * This doesn't seem to be required by the RFCs, but at least
+ * ISC dhcpd and ethereal refuse to recognise it otherwise.
+ */
+ if ( set_dhcp_option ( &dhcppkt->options[OPTS_MAIN],
+ DHCP_MESSAGE_TYPE, &msgtype,
+ sizeof ( msgtype ) ) == NULL )
+ return -ENOSPC;
return 0;
}