浏览代码

[pxe] Fall back to broadcast if no boot server multicast address exists

fetch_ipv4_setting() will zero its IPv4 address argument if no such
setting exists, rather than leaving it untouched.
tags/v0.9.7
Michael Brown 16 年前
父节点
当前提交
4b276b8df9
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2
    1
      src/usr/pxemenu.c

+ 2
- 1
src/usr/pxemenu.c 查看文件

@@ -95,8 +95,9 @@ static int pxe_menu_parse ( struct pxe_menu **menu ) {
95 95
 
96 96
 	/* Fetch relevant settings */
97 97
 	tmp_setting.tag = DHCP_PXE_BOOT_SERVER_MCAST;
98
-	server.s_addr = INADDR_BROADCAST;
99 98
 	fetch_ipv4_setting ( NULL, &tmp_setting, &server );
99
+	if ( ! server.s_addr )
100
+		server.s_addr = INADDR_BROADCAST;
100 101
 	tmp_setting.tag = DHCP_PXE_BOOT_MENU_PROMPT;
101 102
 	fetch_setting ( NULL, &tmp_setting, &prompt, sizeof ( prompt ) );
102 103
 	tmp_setting.tag = DHCP_PXE_BOOT_MENU;

正在加载...
取消
保存