|
@@ -335,6 +335,8 @@ static void dhcp_discovery_rx ( struct dhcp_session *dhcp,
|
335
|
335
|
char vci[9]; /* "PXEClient" */
|
336
|
336
|
int vci_len;
|
337
|
337
|
int has_pxeclient;
|
|
338
|
+ int pxeopts_len;
|
|
339
|
+ int has_pxeopts;
|
338
|
340
|
int8_t priority = 0;
|
339
|
341
|
uint8_t no_pxedhcp = 0;
|
340
|
342
|
unsigned long elapsed;
|
|
@@ -355,8 +357,10 @@ static void dhcp_discovery_rx ( struct dhcp_session *dhcp,
|
355
|
357
|
vci, sizeof ( vci ) );
|
356
|
358
|
has_pxeclient = ( ( vci_len >= ( int ) sizeof ( vci ) ) &&
|
357
|
359
|
( strncmp ( "PXEClient", vci, sizeof (vci) ) == 0 ));
|
|
360
|
+ pxeopts_len = dhcppkt_fetch ( dhcppkt, DHCP_VENDOR_ENCAP, NULL, 0 );
|
|
361
|
+ has_pxeopts = ( pxeopts_len >= 0 );
|
358
|
362
|
if ( has_pxeclient )
|
359
|
|
- DBGC ( dhcp, " pxe" );
|
|
363
|
+ DBGC ( dhcp, "%s", ( has_pxeopts ? " pxe" : " proxy" ) );
|
360
|
364
|
|
361
|
365
|
/* Identify priority */
|
362
|
366
|
dhcppkt_fetch ( dhcppkt, DHCP_EB_PRIORITY, &priority,
|
|
@@ -382,7 +386,7 @@ static void dhcp_discovery_rx ( struct dhcp_session *dhcp,
|
382
|
386
|
}
|
383
|
387
|
|
384
|
388
|
/* Select as ProxyDHCP offer, if applicable */
|
385
|
|
- if ( has_pxeclient && ( msgtype == DHCPOFFER ) &&
|
|
389
|
+ if ( has_pxeclient && ( ! has_pxeopts ) && ( msgtype == DHCPOFFER ) &&
|
386
|
390
|
( priority >= dhcp->proxy_priority ) ) {
|
387
|
391
|
dhcp->proxy_server = server_id;
|
388
|
392
|
dhcp->proxy_priority = priority;
|