diff options
Diffstat (limited to 'meta/recipes-core/busybox/busybox-1.19.4/busybox-udhcpc-no_deconfig.patch')
-rw-r--r-- | meta/recipes-core/busybox/busybox-1.19.4/busybox-udhcpc-no_deconfig.patch | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox-1.19.4/busybox-udhcpc-no_deconfig.patch b/meta/recipes-core/busybox/busybox-1.19.4/busybox-udhcpc-no_deconfig.patch new file mode 100644 index 0000000000..481d8b363a --- /dev/null +++ b/meta/recipes-core/busybox/busybox-1.19.4/busybox-udhcpc-no_deconfig.patch | |||
@@ -0,0 +1,133 @@ | |||
1 | From 16c5fa61059f9862b2534c75dad75f7ece338208 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anders Darander <anders@chargestorm.se> | ||
3 | Date: Thu, 3 Nov 2011 08:51:31 +0100 | ||
4 | Subject: [PATCH] busybox-udhcpc-no_deconfig.patch | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Add a new option -D to the udhcpc client that allows for | ||
9 | dhcp renewal to occur without having to down the interface | ||
10 | in the process. | ||
11 | |||
12 | Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com> | ||
13 | |||
14 | Updated to latest Busybox 1.17.3 | ||
15 | |||
16 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
17 | |||
18 | Updated to Busybox 1.18.4 | ||
19 | option spec is changed | ||
20 | |||
21 | Signed-off-by: Qing He <qing.he@intel.com> | ||
22 | |||
23 | Updated to Busybox 1.19.3 | ||
24 | |||
25 | Signed-off-by: Anders Darander <anders@chargestorm.se> | ||
26 | --- | ||
27 | networking/udhcp/dhcpc.c | 27 ++++++++++++++++++++------- | ||
28 | 1 files changed, 20 insertions(+), 7 deletions(-) | ||
29 | |||
30 | diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c | ||
31 | index 4d755e6..eb80484 100644 | ||
32 | --- a/networking/udhcp/dhcpc.c | ||
33 | +++ b/networking/udhcp/dhcpc.c | ||
34 | @@ -29,6 +29,9 @@ | ||
35 | #include <netpacket/packet.h> | ||
36 | #include <linux/filter.h> | ||
37 | |||
38 | +/* option whether to down the interface when reconfiguring */ | ||
39 | +static int allow_deconfig = 1; | ||
40 | + | ||
41 | /* struct client_config_t client_config is in bb_common_bufsiz1 */ | ||
42 | |||
43 | |||
44 | @@ -82,6 +85,7 @@ enum { | ||
45 | OPT_x = 1 << 18, | ||
46 | OPT_f = 1 << 19, | ||
47 | OPT_B = 1 << 20, | ||
48 | + OPT_D = 1 << 21, | ||
49 | /* The rest has variable bit positions, need to be clever */ | ||
50 | OPTBIT_B = 20, | ||
51 | USE_FOR_MMU( OPTBIT_b,) | ||
52 | @@ -899,7 +903,8 @@ static void perform_renew(void) | ||
53 | state = RENEW_REQUESTED; | ||
54 | break; | ||
55 | case RENEW_REQUESTED: /* impatient are we? fine, square 1 */ | ||
56 | - udhcp_run_script(NULL, "deconfig"); | ||
57 | + if (allow_deconfig) | ||
58 | + udhcp_run_script(NULL, "deconfig"); | ||
59 | case REQUESTING: | ||
60 | case RELEASED: | ||
61 | change_listen_mode(LISTEN_RAW); | ||
62 | @@ -923,7 +928,8 @@ static void perform_release(uint32_t requested_ip, uint32_t server_addr) | ||
63 | bb_info_msg("Unicasting a release of %s to %s", | ||
64 | inet_ntoa(temp_addr), buffer); | ||
65 | send_release(server_addr, requested_ip); /* unicast */ | ||
66 | - udhcp_run_script(NULL, "deconfig"); | ||
67 | + if (allow_deconfig) | ||
68 | + udhcp_run_script(NULL, "deconfig"); | ||
69 | } | ||
70 | bb_info_msg("Entering released state"); | ||
71 | |||
72 | @@ -1083,7 +1089,7 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | ||
73 | #endif | ||
74 | ; | ||
75 | IF_LONG_OPTS(applet_long_options = udhcpc_longopts;) | ||
76 | - opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fB" | ||
77 | + opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fBD" | ||
78 | USE_FOR_MMU("b") | ||
79 | IF_FEATURE_UDHCPC_ARPING("a") | ||
80 | IF_FEATURE_UDHCP_PORT("P:") | ||
81 | @@ -1175,6 +1181,9 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | ||
82 | logmode |= LOGMODE_SYSLOG; | ||
83 | } | ||
84 | |||
85 | + if (opt & OPT_D) | ||
86 | + allow_deconfig = 0; | ||
87 | + | ||
88 | /* Make sure fd 0,1,2 are open */ | ||
89 | bb_sanitize_stdio(); | ||
90 | /* Equivalent of doing a fflush after every \n */ | ||
91 | @@ -1189,7 +1198,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | ||
92 | srand(monotonic_us()); | ||
93 | |||
94 | state = INIT_SELECTING; | ||
95 | - udhcp_run_script(NULL, "deconfig"); | ||
96 | + if (allow_deconfig) | ||
97 | + udhcp_run_script(NULL, "deconfig"); | ||
98 | change_listen_mode(LISTEN_RAW); | ||
99 | packet_num = 0; | ||
100 | timeout = 0; | ||
101 | @@ -1341,7 +1351,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | ||
102 | } | ||
103 | /* Timed out, enter init state */ | ||
104 | bb_info_msg("Lease lost, entering init state"); | ||
105 | - udhcp_run_script(NULL, "deconfig"); | ||
106 | + if (allow_deconfig) | ||
107 | + udhcp_run_script(NULL, "deconfig"); | ||
108 | state = INIT_SELECTING; | ||
109 | client_config.first_secs = 0; /* make secs field count from 0 */ | ||
110 | /*timeout = 0; - already is */ | ||
111 | @@ -1489,7 +1500,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | ||
112 | send_decline(xid, server_addr, packet.yiaddr); | ||
113 | |||
114 | if (state != REQUESTING) | ||
115 | - udhcp_run_script(NULL, "deconfig"); | ||
116 | + if (allow_deconfig) | ||
117 | + udhcp_run_script(NULL, "deconfig"); | ||
118 | change_listen_mode(LISTEN_RAW); | ||
119 | state = INIT_SELECTING; | ||
120 | client_config.first_secs = 0; /* make secs field count from 0 */ | ||
121 | @@ -1536,7 +1548,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) | ||
122 | bb_info_msg("Received DHCP NAK"); | ||
123 | udhcp_run_script(&packet, "nak"); | ||
124 | if (state != REQUESTING) | ||
125 | - udhcp_run_script(NULL, "deconfig"); | ||
126 | + if (allow_deconfig) | ||
127 | + udhcp_run_script(NULL, "deconfig"); | ||
128 | change_listen_mode(LISTEN_RAW); | ||
129 | sleep(3); /* avoid excessive network traffic */ | ||
130 | state = INIT_SELECTING; | ||
131 | -- | ||
132 | 1.7.7.1 | ||
133 | |||