|
@@ -401,6 +401,7 @@ static void dhcp_rx_offer ( struct dhcp_session *dhcp,
|
401
|
401
|
int has_pxeclient;
|
402
|
402
|
int pxeopts_len;
|
403
|
403
|
int has_pxeopts;
|
|
404
|
+ uint8_t discovery_control = 0;
|
404
|
405
|
struct dhcp_offer *offer;
|
405
|
406
|
int i;
|
406
|
407
|
|
|
@@ -439,9 +440,32 @@ static void dhcp_rx_offer ( struct dhcp_session *dhcp,
|
439
|
440
|
has_pxeclient = ( ( vci_len >= ( int ) sizeof ( vci ) ) &&
|
440
|
441
|
( strncmp ( "PXEClient", vci, sizeof (vci) ) == 0 ));
|
441
|
442
|
|
442
|
|
- /* Identify presence of PXE-specific options */
|
|
443
|
+ /*
|
|
444
|
+ * Identify presence of PXE-specific options
|
|
445
|
+ *
|
|
446
|
+ * The Intel firmware appears to check for:
|
|
447
|
+ * - PXE_DISCOVERY_CONTROL exists and has bit 3 set, or
|
|
448
|
+ * - both PXE_BOOT_MENU and PXE_BOOT_MENU_PROMPT exist
|
|
449
|
+ *
|
|
450
|
+ * If DISCOVERY_CONTROL bit 3 is set, the firmware treats this
|
|
451
|
+ * packet like a "normal" non-PXE DHCP packet with respect to
|
|
452
|
+ * boot filename, except that it can come from ProxyDHCP. This
|
|
453
|
+ * is the scheme that dnsmasq uses in the simple case.
|
|
454
|
+ *
|
|
455
|
+ * Otherwise, if one of the boot menu / boot menu prompt
|
|
456
|
+ * options exists but not both, the firmware signals an
|
|
457
|
+ * error. If neither exists, the packet is not considered to
|
|
458
|
+ * contain DHCP options.
|
|
459
|
+ *
|
|
460
|
+ * In an effort to preserve semantics but be more flexible, we
|
|
461
|
+ * check only for bit 3 of DISCOVERY_CONTROL or the presence
|
|
462
|
+ * of BOOT_MENU. We don't care (yet) about the menu prompt.
|
|
463
|
+ */
|
443
|
464
|
pxeopts_len = dhcppkt_fetch ( dhcppkt, DHCP_PXE_BOOT_MENU, NULL, 0 );
|
444
|
|
- has_pxeopts = ( pxeopts_len >= 0 );
|
|
465
|
+ dhcppkt_fetch ( dhcppkt, DHCP_PXE_DISCOVERY_CONTROL,
|
|
466
|
+ &discovery_control, sizeof ( discovery_control ) );
|
|
467
|
+ has_pxeopts = ( ( pxeopts_len >= 0 ) ||
|
|
468
|
+ ( discovery_control & PXEBS_SKIP ) );
|
445
|
469
|
if ( has_pxeclient )
|
446
|
470
|
DBGC ( dhcp, "%s", ( has_pxeopts ? " pxe" : " proxy" ) );
|
447
|
471
|
|