2015-04-04 17:52:02 +00:00
|
|
|
--- a/networking/udhcp/dhcpc.c
|
|
|
|
+++ b/networking/udhcp/dhcpc.c
|
|
|
|
@@ -663,10 +663,10 @@ static void add_client_options(struct dh
|
2014-05-29 10:35:34 +00:00
|
|
|
* client reverts to using the IP broadcast address.
|
|
|
|
*/
|
|
|
|
|
|
|
|
-static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet)
|
|
|
|
+static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet, uint32_t src_nip)
|
|
|
|
{
|
|
|
|
return udhcp_send_raw_packet(packet,
|
|
|
|
- /*src*/ INADDR_ANY, CLIENT_PORT,
|
|
|
|
+ /*src*/ src_nip, CLIENT_PORT,
|
|
|
|
/*dst*/ INADDR_BROADCAST, SERVER_PORT, MAC_BCAST_ADDR,
|
|
|
|
client_config.ifindex);
|
|
|
|
}
|
2015-04-04 17:52:02 +00:00
|
|
|
@@ -677,7 +677,7 @@ static int bcast_or_ucast(struct dhcp_pa
|
2014-05-29 10:35:34 +00:00
|
|
|
return udhcp_send_kernel_packet(packet,
|
|
|
|
ciaddr, CLIENT_PORT,
|
|
|
|
server, SERVER_PORT);
|
|
|
|
- return raw_bcast_from_client_config_ifindex(packet);
|
|
|
|
+ return raw_bcast_from_client_config_ifindex(packet, ciaddr);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Broadcast a DHCP discover packet to the network, with an optionally requested IP */
|
2015-04-04 17:52:02 +00:00
|
|
|
@@ -705,7 +705,7 @@ static NOINLINE int send_discover(uint32
|
2014-05-29 10:35:34 +00:00
|
|
|
|
|
|
|
if (msgs++ < 3)
|
|
|
|
bb_info_msg("Sending discover...");
|
|
|
|
- return raw_bcast_from_client_config_ifindex(&packet);
|
|
|
|
+ return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Broadcast a DHCP request message */
|
2015-04-04 17:52:02 +00:00
|
|
|
@@ -749,7 +749,7 @@ static NOINLINE int send_select(uint32_t
|
2014-05-29 10:35:34 +00:00
|
|
|
|
|
|
|
addr.s_addr = requested;
|
|
|
|
bb_info_msg("Sending select for %s...", inet_ntoa(addr));
|
|
|
|
- return raw_bcast_from_client_config_ifindex(&packet);
|
|
|
|
+ return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Unicast or broadcast a DHCP renew message */
|
2015-04-04 17:52:02 +00:00
|
|
|
@@ -817,7 +817,7 @@ static NOINLINE int send_decline(/*uint3
|
2014-05-29 10:35:34 +00:00
|
|
|
udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
|
|
|
|
|
|
|
|
bb_info_msg("Sending decline...");
|
|
|
|
- return raw_bcast_from_client_config_ifindex(&packet);
|
|
|
|
+ return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|