[dhcp] Add preliminary support for PXE Boot Servers

Some PXE configurations require us to perform a third DHCP transaction
(in addition to the real DHCP transaction and the ProxyDHCP
transaction) in order to retrieve information from a "Boot Server".

This is an experimental implementation, since the actual behaviour is
not well specified in the PXE spec.
This commit is contained in:
Michael Brown
2009-01-21 03:43:26 +00:00
parent d230b53df2
commit 6941793416
3 changed files with 109 additions and 1 deletions

View File

@@ -176,6 +176,7 @@ int create_fakeproxydhcpack ( struct net_device *netdev,
void *data, size_t max_len ) {
struct dhcp_packet dhcppkt;
struct settings *settings;
struct settings *bs_settings;
int rc;
/* Identify ProxyDHCP settings */
@@ -200,5 +201,15 @@ int create_fakeproxydhcpack ( struct net_device *netdev,
return rc;
}
/* Merge in BootServerDHCP options, if present */
bs_settings = find_settings ( BSDHCP_SETTINGS_NAME );
if ( bs_settings ) {
if ( ( rc = copy_settings ( &dhcppkt, bs_settings ) ) != 0 ) {
DBG ( "Could not set BootServerDHCPACK settings: "
"%s\n", strerror ( rc ) );
return rc;
}
}
return 0;
}