mirror of
https://github.com/ipxe/ipxe
synced 2025-12-28 18:42:53 +03:00
[dhcp] Request broadcast responses when we already have an IPv4 address
FCoE requires the use of multiple local unicast link-layer addresses. To avoid the complexity of managing multiple addresses, iPXE operates in promiscuous mode. As a consequence, any unicast packets with non-matching IPv4 addresses are rejected at the IPv4 layer (rather than at the link layer). This can cause problems when issuing a second DHCP request: if the address chosen by the DHCP server does not match the existing address, then the DHCP response will itself be rejected. Fix by requesting a broadcast response from the DHCP server if the network interface already has any IPv4 addresses. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -941,6 +941,13 @@ int dhcp_create_packet ( struct dhcp_packet *dhcppkt,
|
||||
&dhcphdr->flags );
|
||||
memcpy ( dhcphdr->options, options, options_len );
|
||||
|
||||
/* If the network device already has an IPv4 address then
|
||||
* unicast responses from the DHCP server may be rejected, so
|
||||
* request broadcast responses.
|
||||
*/
|
||||
if ( ipv4_has_any_addr ( netdev ) )
|
||||
dhcphdr->flags |= htons ( BOOTP_FL_BROADCAST );
|
||||
|
||||
/* Initialise DHCP packet structure */
|
||||
memset ( dhcppkt, 0, sizeof ( *dhcppkt ) );
|
||||
dhcppkt_init ( dhcppkt, data, max_len );
|
||||
|
||||
Reference in New Issue
Block a user