aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/udhcp/dhcpc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
index 2fe84e1ca..6c2b112f0 100644
--- a/networking/udhcp/dhcpc.c
+++ b/networking/udhcp/dhcpc.c
@@ -675,10 +675,10 @@ static void add_client_options(struct dhcp_packet *packet)
675 * client reverts to using the IP broadcast address. 675 * client reverts to using the IP broadcast address.
676 */ 676 */
677 677
678static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet) 678static int raw_bcast_from_client_config_ifindex(struct dhcp_packet *packet, uint32_t src_nip)
679{ 679{
680 return udhcp_send_raw_packet(packet, 680 return udhcp_send_raw_packet(packet,
681 /*src*/ INADDR_ANY, CLIENT_PORT, 681 /*src*/ src_nip, CLIENT_PORT,
682 /*dst*/ INADDR_BROADCAST, SERVER_PORT, MAC_BCAST_ADDR, 682 /*dst*/ INADDR_BROADCAST, SERVER_PORT, MAC_BCAST_ADDR,
683 client_config.ifindex); 683 client_config.ifindex);
684} 684}
@@ -689,7 +689,7 @@ static int bcast_or_ucast(struct dhcp_packet *packet, uint32_t ciaddr, uint32_t
689 return udhcp_send_kernel_packet(packet, 689 return udhcp_send_kernel_packet(packet,
690 ciaddr, CLIENT_PORT, 690 ciaddr, CLIENT_PORT,
691 server, SERVER_PORT); 691 server, SERVER_PORT);
692 return raw_bcast_from_client_config_ifindex(packet); 692 return raw_bcast_from_client_config_ifindex(packet, ciaddr);
693} 693}
694 694
695/* Broadcast a DHCP discover packet to the network, with an optionally requested IP */ 695/* Broadcast a DHCP discover packet to the network, with an optionally requested IP */
@@ -715,7 +715,7 @@ static NOINLINE int send_discover(uint32_t xid, uint32_t requested)
715 add_client_options(&packet); 715 add_client_options(&packet);
716 716
717 bb_info_msg("Sending discover..."); 717 bb_info_msg("Sending discover...");
718 return raw_bcast_from_client_config_ifindex(&packet); 718 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
719} 719}
720 720
721/* Broadcast a DHCP request message */ 721/* Broadcast a DHCP request message */
@@ -759,7 +759,7 @@ static NOINLINE int send_select(uint32_t xid, uint32_t server, uint32_t requeste
759 759
760 addr.s_addr = requested; 760 addr.s_addr = requested;
761 bb_info_msg("Sending select for %s...", inet_ntoa(addr)); 761 bb_info_msg("Sending select for %s...", inet_ntoa(addr));
762 return raw_bcast_from_client_config_ifindex(&packet); 762 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
763} 763}
764 764
765/* Unicast or broadcast a DHCP renew message */ 765/* Unicast or broadcast a DHCP renew message */
@@ -827,7 +827,7 @@ static NOINLINE int send_decline(/*uint32_t xid,*/ uint32_t server, uint32_t req
827 udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server); 827 udhcp_add_simple_option(&packet, DHCP_SERVER_ID, server);
828 828
829 bb_info_msg("Sending decline..."); 829 bb_info_msg("Sending decline...");
830 return raw_bcast_from_client_config_ifindex(&packet); 830 return raw_bcast_from_client_config_ifindex(&packet, INADDR_ANY);
831} 831}
832#endif 832#endif
833 833