aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-05-29 10:35:34 +0000
committerSteven Barth <steven@midlink.org>2014-05-29 10:35:34 +0000
commit139153ff6c4d3fc3d7335bc7d5836a8cf26a62c9 (patch)
tree3cb82f762368daf1a75972cb1ef2634452541bad /package/utils
parentb37fc42ba75a909df07cbfe8336b9a66f4cf5c42 (diff)
downloadupstream-139153ff6c4d3fc3d7335bc7d5836a8cf26a62c9.tar.gz
upstream-139153ff6c4d3fc3d7335bc7d5836a8cf26a62c9.tar.bz2
upstream-139153ff6c4d3fc3d7335bc7d5836a8cf26a62c9.zip
busybox: udhcpc source IP rebind patch
Patch sets the source IP address of DHCP request messages during rebind to the IP address assigned to the udhcpc client. Source address 0.0.0.0 can only be used by a client prior to obtaining its IP address (see RFC2131 ยง 4.1). Source IP address behavior lines up now with the ISC dhcp client implementation for DHCP request messages during rebind and DHCP release messages. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@40878 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/utils')
-rw-r--r--package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch b/package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch
new file mode 100644
index 0000000000..6da568a914
--- /dev/null
+++ b/package/utils/busybox/patches/204-udhcpc_src_ip_rebind.patch
@@ -0,0 +1,53 @@
+Index: busybox-1.22.1/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.22.1.orig/networking/udhcp/dhcpc.c
++++ busybox-1.22.1/networking/udhcp/dhcpc.c
+@@ -659,10 +659,10 @@ static void add_client_options(struct dh
+ * 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);
+ }
+@@ -673,7 +673,7 @@ static int bcast_or_ucast(struct dhcp_pa
+ 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 */
+@@ -701,7 +701,7 @@ static NOINLINE int send_discover(uint32
+
+ 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 */
+@@ -745,7 +745,7 @@ static NOINLINE int send_select(uint32_t
+
+ 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 */
+@@ -813,7 +813,7 @@ static NOINLINE int send_decline(/*uint3
+ 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
+