[pxe] Fall back to broadcast if no boot server multicast address exists
authorMichael Brown <mcb30@etherboot.org>
Tue, 3 Feb 2009 02:44:15 +0000 (02:44 +0000)
committerMichael Brown <mcb30@etherboot.org>
Tue, 3 Feb 2009 02:44:15 +0000 (02:44 +0000)
fetch_ipv4_setting() will zero its IPv4 address argument if no such
setting exists, rather than leaving it untouched.

src/usr/pxemenu.c

index 3f5bfc8..ae97108 100644 (file)
@@ -95,8 +95,9 @@ static int pxe_menu_parse ( struct pxe_menu **menu ) {
 
        /* Fetch relevant settings */
        tmp_setting.tag = DHCP_PXE_BOOT_SERVER_MCAST;
-       server.s_addr = INADDR_BROADCAST;
        fetch_ipv4_setting ( NULL, &tmp_setting, &server );
+       if ( ! server.s_addr )
+               server.s_addr = INADDR_BROADCAST;
        tmp_setting.tag = DHCP_PXE_BOOT_MENU_PROMPT;
        fetch_setting ( NULL, &tmp_setting, &prompt, sizeof ( prompt ) );
        tmp_setting.tag = DHCP_PXE_BOOT_MENU;