1 --- a/networking/udhcp/dhcpc.c
2 +++ b/networking/udhcp/dhcpc.c
3 @@ -663,10 +663,10 @@ static void add_client_options(struct dh
4 * client reverts to using the IP broadcast address.
7 -static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet)
8 +static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet, uint32_t src_nip)
10 return udhcp_send_raw_packet(packet,
11 - /*src*/ INADDR_ANY, CLIENT_PORT,
12 + /*src*/ src_nip, CLIENT_PORT,
13 /*dst*/ INADDR_BROADCAST, SERVER_PORT, MAC_BCAST_ADDR,
14 client_config.ifindex);
16 @@ -677,7 +677,7 @@ static int bcast_or_ucast(struct dhcp_pa
17 return udhcp_send_kernel_packet(packet,
20 - return raw_bcast_from_client_config_ifindex(packet);
21 + return raw_bcast_from_client_config_ifindex(packet, ciaddr);
24 /* Broadcast a DHCP discover packet to the network, with an optionally requested IP */
25 @@ -705,7 +705,7 @@ static NOINLINE int send_discover(uint32
28 bb_info_msg("Sending discover...");
29 - return raw_bcast_from_client_config_ifindex(&packet);
30 + return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
33 /* Broadcast a DHCP request message */
34 @@ -749,7 +749,7 @@ static NOINLINE int send_select(uint32_t
36 addr.s_addr = requested;
37 bb_info_msg("Sending select for %s...", inet_ntoa(addr));
38 - return raw_bcast_from_client_config_ifindex(&packet);
39 + return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
42 /* Unicast or broadcast a DHCP renew message */
43 @@ -817,7 +817,7 @@ static NOINLINE int send_decline(/*uint3
44 udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
46 bb_info_msg("Sending decline...");
47 - return raw_bcast_from_client_config_ifindex(&packet);
48 + return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);