summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
diff options
context:
space:
mode:
authorTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
committerTudor Florea <tudor.florea@enea.com>2014-10-16 03:05:19 +0200
commitc527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch)
treebb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
downloadpoky-daisy-140929.tar.gz
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch')
-rw-r--r--meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch137
1 files changed, 137 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
new file mode 100644
index 0000000000..4c9ce3b711
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
@@ -0,0 +1,137 @@
1From 53626cd06a3ef05ed847daea802ef0aa9661caa7 Mon Sep 17 00:00:00 2001
2From: Anders Darander <anders@chargestorm.se>
3Date: Thu, 3 Nov 2011 08:51:31 +0100
4Subject: [PATCH] busybox-udhcpc-no_deconfig.patch
5
6Upstream-Status: Pending
7
8Add a new option -D to the udhcpc client that allows for
9dhcp renewal to occur without having to down the interface
10in the process.
11
12Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com>
13
14Updated to latest Busybox 1.17.3
15
16Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
17
18Updated to Busybox 1.18.4
19option spec is changed
20
21Signed-off-by: Qing He <qing.he@intel.com>
22
23Updated to Busybox 1.19.3
24
25Signed-off-by: Anders Darander <anders@chargestorm.se>
26
27Fixed options -b, -a and -P.
28
29Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
30---
31 networking/udhcp/dhcpc.c | 29 +++++++++++++++++++++--------
32 1 files changed, 21 insertions(+), 8 deletions(-)
33
34Index: busybox-1.20.2/networking/udhcp/dhcpc.c
35===================================================================
36--- busybox-1.20.2.orig/networking/udhcp/dhcpc.c
37+++ busybox-1.20.2/networking/udhcp/dhcpc.c
38@@ -29,6 +29,9 @@
39 #include <netpacket/packet.h>
40 #include <linux/filter.h>
41
42+/* option whether to down the interface when reconfiguring */
43+static int allow_deconfig = 1;
44+
45 /* "struct client_config_t client_config" is in bb_common_bufsiz1 */
46
47
48@@ -81,8 +84,9 @@ enum {
49 OPT_x = 1 << 18,
50 OPT_f = 1 << 19,
51 OPT_B = 1 << 20,
52+ OPT_D = 1 << 21,
53 /* The rest has variable bit positions, need to be clever */
54- OPTBIT_B = 20,
55+ OPTBIT_D = 21,
56 USE_FOR_MMU( OPTBIT_b,)
57 IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
58 IF_FEATURE_UDHCP_PORT( OPTBIT_P,)
59@@ -1040,7 +1044,8 @@ static void perform_renew(void)
60 state = RENEW_REQUESTED;
61 break;
62 case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
63- udhcp_run_script(NULL, "deconfig");
64+ if (allow_deconfig)
65+ udhcp_run_script(NULL, "deconfig");
66 case REQUESTING:
67 case RELEASED:
68 change_listen_mode(LISTEN_RAW);
69@@ -1064,7 +1069,8 @@ static void perform_release(uint32_t ser
70 bb_info_msg("Unicasting a release of %s to %s",
71 inet_ntoa(temp_addr), buffer);
72 send_release(server_addr, requested_ip); /* unicast */
73- udhcp_run_script(NULL, "deconfig");
74+ if (allow_deconfig)
75+ udhcp_run_script(NULL, "deconfig");
76 }
77 bb_info_msg("Entering released state");
78
79@@ -1215,7 +1221,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c
80 /* O,x: list; -T,-t,-A take numeric param */
81 opt_complementary = "O::x::T+:t+:A+" IF_UDHCP_VERBOSE(":vv") ;
82 IF_LONG_OPTS(applet_long_options = udhcpc_longopts;)
83- opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fB"
84+ opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fBD"
85 USE_FOR_MMU("b")
86 IF_FEATURE_UDHCPC_ARPING("a")
87 IF_FEATURE_UDHCP_PORT("P:")
88@@ -1316,6 +1322,9 @@ int udhcpc_main(int argc UNUSED_PARAM, c
89 logmode |= LOGMODE_SYSLOG;
90 }
91
92+ if (opt & OPT_D)
93+ allow_deconfig = 0;
94+
95 /* Make sure fd 0,1,2 are open */
96 bb_sanitize_stdio();
97 /* Equivalent of doing a fflush after every \n */
98@@ -1330,7 +1339,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
99 srand(monotonic_us());
100
101 state = INIT_SELECTING;
102- udhcp_run_script(NULL, "deconfig");
103+ if (allow_deconfig)
104+ udhcp_run_script(NULL, "deconfig");
105 change_listen_mode(LISTEN_RAW);
106 packet_num = 0;
107 timeout = 0;
108@@ -1484,7 +1494,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
109 }
110 /* Timed out, enter init state */
111 bb_info_msg("Lease lost, entering init state");
112- udhcp_run_script(NULL, "deconfig");
113+ if (allow_deconfig)
114+ udhcp_run_script(NULL, "deconfig");
115 state = INIT_SELECTING;
116 client_config.first_secs = 0; /* make secs field count from 0 */
117 /*timeout = 0; - already is */
118@@ -1667,7 +1678,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
119 send_decline(/*xid,*/ server_addr, packet.yiaddr);
120
121 if (state != REQUESTING)
122- udhcp_run_script(NULL, "deconfig");
123+ if (allow_deconfig)
124+ udhcp_run_script(NULL, "deconfig");
125 change_listen_mode(LISTEN_RAW);
126 state = INIT_SELECTING;
127 client_config.first_secs = 0; /* make secs field count from 0 */
128@@ -1711,7 +1723,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
129 bb_info_msg("Received DHCP NAK");
130 udhcp_run_script(&packet, "nak");
131 if (state != REQUESTING)
132- udhcp_run_script(NULL, "deconfig");
133+ if (allow_deconfig)
134+ udhcp_run_script(NULL, "deconfig");
135 change_listen_mode(LISTEN_RAW);
136 sleep(3); /* avoid excessive network traffic */
137 state = INIT_SELECTING;