diff -urN gpxe-0.9.7/src/net/udp/dhcp.c gpxe-0.9.7-pdhcp67/src/net/udp/dhcp.c --- gpxe-0.9.7/src/net/udp/dhcp.c 2009-08-21 21:33:52.000000000 -0400 +++ gpxe-0.9.7-pdhcp67/src/net/udp/dhcp.c 2009-08-21 21:33:13.000000000 -0400 @@ -668,8 +668,13 @@ struct dhcp_pxe_boot_menu_item menu_item = { 0, 0 }; int rc; + /* Set server address */ + peer->sin_addr = *(dhcp->pxe_attempt); + peer->sin_port = ( ( peer->sin_addr.s_addr == INADDR_BROADCAST ) ? + htons ( BOOTPS_PORT ) : htons ( PXE_PORT ) ); + DBGC ( dhcp, "DHCP %p PXEBS REQUEST to %s:%d for type %d\n", - dhcp, inet_ntoa ( *(dhcp->pxe_attempt) ), PXE_PORT, + dhcp, inet_ntoa ( peer->sin_addr ), ntohs ( peer->sin_port ), ntohs ( dhcp->pxe_type ) ); /* Set boot menu item */ @@ -678,10 +683,6 @@ &menu_item, sizeof ( menu_item ) ) ) != 0 ) return rc; - /* Set server address */ - peer->sin_addr = *(dhcp->pxe_attempt); - peer->sin_port = htons ( PXE_PORT ); - return 0; } @@ -741,7 +742,8 @@ DBGC ( dhcp, "\n" ); /* Filter out unacceptable responses */ - if ( peer->sin_port != htons ( PXE_PORT ) ) + if ( ( peer->sin_port != htons ( BOOTPS_PORT ) ) && + ( peer->sin_port != htons ( PXE_PORT ) ) ) return; if ( msgtype != DHCPACK ) return;