busybox: update to version 1.23.2
[openwrt/svn-archive/archive.git] / package / utils / busybox / patches / 204-udhcpc_src_ip_rebind.patch
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.
5 */
6
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)
9 {
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);
15 }
16 @@ -677,7 +677,7 @@ static int bcast_or_ucast(struct dhcp_pa
17 return udhcp_send_kernel_packet(packet,
18 ciaddr, CLIENT_PORT,
19 server, SERVER_PORT);
20 - return raw_bcast_from_client_config_ifindex(packet);
21 + return raw_bcast_from_client_config_ifindex(packet, ciaddr);
22 }
23
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
26
27 if (msgs++ < 3)
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);
31 }
32
33 /* Broadcast a DHCP request message */
34 @@ -749,7 +749,7 @@ static NOINLINE int send_select(uint32_t
35
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);
40 }
41
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);
45
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);
49 }
50 #endif
51