summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f4bf4e6)
This prevents gPXE from wasting time attempting to contact a ProxyDHCP
server on port 4011 if the DHCP response already contains the relevant
PXE options. This behaviour is hinted at (though not explicitly
specified) in the PXE spec, and seems to match what the Intel client
does.
Suggested-by: Simon Kelley <simon@thekelleys.org.uk>
char vci[9]; /* "PXEClient" */
int vci_len;
int has_pxeclient;
char vci[9]; /* "PXEClient" */
int vci_len;
int has_pxeclient;
+ int pxeopts_len;
+ int has_pxeopts;
int8_t priority = 0;
uint8_t no_pxedhcp = 0;
unsigned long elapsed;
int8_t priority = 0;
uint8_t no_pxedhcp = 0;
unsigned long elapsed;
vci, sizeof ( vci ) );
has_pxeclient = ( ( vci_len >= ( int ) sizeof ( vci ) ) &&
( strncmp ( "PXEClient", vci, sizeof (vci) ) == 0 ));
vci, sizeof ( vci ) );
has_pxeclient = ( ( vci_len >= ( int ) sizeof ( vci ) ) &&
( strncmp ( "PXEClient", vci, sizeof (vci) ) == 0 ));
+ pxeopts_len = dhcppkt_fetch ( dhcppkt, DHCP_VENDOR_ENCAP, NULL, 0 );
+ has_pxeopts = ( pxeopts_len >= 0 );
+ DBGC ( dhcp, "%s", ( has_pxeopts ? " pxe" : " proxy" ) );
/* Identify priority */
dhcppkt_fetch ( dhcppkt, DHCP_EB_PRIORITY, &priority,
/* Identify priority */
dhcppkt_fetch ( dhcppkt, DHCP_EB_PRIORITY, &priority,
}
/* Select as ProxyDHCP offer, if applicable */
}
/* Select as ProxyDHCP offer, if applicable */
- if ( has_pxeclient && ( msgtype == DHCPOFFER ) &&
+ if ( has_pxeclient && ( ! has_pxeopts ) && ( msgtype == DHCPOFFER ) &&
( priority >= dhcp->proxy_priority ) ) {
dhcp->proxy_server = server_id;
dhcp->proxy_priority = priority;
( priority >= dhcp->proxy_priority ) ) {
dhcp->proxy_server = server_id;
dhcp->proxy_priority = priority;