diff options
author | Michael Brown | 2009-01-21 01:55:42 +0100 |
---|---|---|
committer | Michael Brown | 2009-01-21 01:55:42 +0100 |
commit | d7de30e5e47ded29599c4ef2ba37ddbf3913f4b0 (patch) | |
tree | 487d298e6acf52abb98b72d2f586ef331b7fc7ff /src/net/udp/dhcp.c | |
parent | [efi] Expose both GUIDs for the EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL (diff) | |
download | ipxe-d7de30e5e47ded29599c4ef2ba37ddbf3913f4b0.tar.gz ipxe-d7de30e5e47ded29599c4ef2ba37ddbf3913f4b0.tar.xz ipxe-d7de30e5e47ded29599c4ef2ba37ddbf3913f4b0.zip |
[dhcp] Allow for missing server ID in ProxyDHCPACK
The Linux PXE server (http://www.kano.org.uk/projects/pxe) does not
set the server identifier in its ProxyDHCP responses. If the server
ID is missing, do not treat this as an error.
This resolves the "vague and unsettling memory" mentioned in commit
fdb8481d ("[dhcp] Verify server identifier on ProxyDHCPACKs").
Note that we already accept ProxyDHCPOFFERs without a server
identifier; they get treated as potential BOOTP packets.
Diffstat (limited to 'src/net/udp/dhcp.c')
-rw-r--r-- | src/net/udp/dhcp.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/net/udp/dhcp.c b/src/net/udp/dhcp.c index 2ef8c084..40670232 100644 --- a/src/net/udp/dhcp.c +++ b/src/net/udp/dhcp.c @@ -845,16 +845,20 @@ static void dhcp_rx_proxydhcpack ( struct dhcp_session *dhcp, struct in_addr ack_server_id = { 0 }; int rc; - /* Verify server ID matches */ + /* Verify server ID matches, if present */ assert ( dhcp->proxydhcpoffer != NULL ); - dhcppkt_fetch ( &dhcp->proxydhcpoffer->dhcppkt, DHCP_SERVER_IDENTIFIER, - &offer_server_id, sizeof ( offer_server_id ) ); - dhcppkt_fetch ( &proxydhcpack->dhcppkt, DHCP_SERVER_IDENTIFIER, - &ack_server_id, sizeof ( ack_server_id ) ); - if ( offer_server_id.s_addr != ack_server_id.s_addr ) { - DBGC ( dhcp, "DHCP %p ignoring ProxyDHCPACK with wrong server " - "ID %s\n", dhcp, inet_ntoa ( ack_server_id ) ); - return; + if ( ( rc = dhcppkt_fetch ( &proxydhcpack->dhcppkt, + DHCP_SERVER_IDENTIFIER, &ack_server_id, + sizeof ( ack_server_id ) ) ) > 0 ) { + dhcppkt_fetch ( &dhcp->proxydhcpoffer->dhcppkt, + DHCP_SERVER_IDENTIFIER, &offer_server_id, + sizeof ( offer_server_id ) ); + if ( offer_server_id.s_addr != ack_server_id.s_addr ) { + DBGC ( dhcp, "DHCP %p ignoring ProxyDHCPACK with " + "wrong server ID %s\n", + dhcp, inet_ntoa ( ack_server_id ) ); + return; + } } /* Rename settings */ |