diff options
Diffstat (limited to 'meta/recipes-core/busybox/busybox-1.18.5/busybox-udhcpc-no_deconfig.patch')
-rw-r--r-- | meta/recipes-core/busybox/busybox-1.18.5/busybox-udhcpc-no_deconfig.patch | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/busybox-1.18.5/busybox-udhcpc-no_deconfig.patch b/meta/recipes-core/busybox/busybox-1.18.5/busybox-udhcpc-no_deconfig.patch new file mode 100644 index 0000000000..405d4823af --- /dev/null +++ b/meta/recipes-core/busybox/busybox-1.18.5/busybox-udhcpc-no_deconfig.patch | |||
@@ -0,0 +1,117 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Add a new option -D to the udhcpc client that allows for | ||
4 | dhcp renewal to occur without having to down the interface | ||
5 | in the process. | ||
6 | |||
7 | Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com> | ||
8 | |||
9 | Updated to latest Busybox 1.17.3 | ||
10 | |||
11 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
12 | |||
13 | Updated to Busybox 1.18.4 | ||
14 | option spec is changed | ||
15 | |||
16 | Signed-off-by: Qing He <qing.he@intel.com> | ||
17 | |||
18 | diff -ur busybox-1.17.3.orig/networking/udhcp/dhcpc.c busybox-1.17.3/networking/udhcp/dhcpc.c | ||
19 | --- busybox-1.17.3.orig/networking/udhcp/dhcpc.c | ||
20 | +++ busybox-1.17.3/networking/udhcp/dhcpc.c | ||
21 | @@ -35,6 +35,9 @@ | ||
22 | #endif | ||
23 | #include <linux/filter.h> | ||
24 | |||
25 | +/* option whether to down the interface when reconfiguring */ | ||
26 | +static int allow_deconfig = 1; | ||
27 | + | ||
28 | /* struct client_config_t client_config is in bb_common_bufsiz1 */ | ||
29 | |||
30 | |||
31 | @@ -709,7 +712,8 @@ | ||
32 | state = RENEW_REQUESTED; | ||
33 | break; | ||
34 | case RENEW_REQUESTED: /* impatient are we? fine, square 1 */ | ||
35 | - udhcp_run_script(NULL, "deconfig"); | ||
36 | + if (allow_deconfig) | ||
37 | + udhcp_run_script(NULL, "deconfig"); | ||
38 | case REQUESTING: | ||
39 | case RELEASED: | ||
40 | change_listen_mode(LISTEN_RAW); | ||
41 | @@ -733,7 +737,8 @@ | ||
42 | bb_info_msg("Unicasting a release of %s to %s", | ||
43 | inet_ntoa(temp_addr), buffer); | ||
44 | send_release(server_addr, requested_ip); /* unicast */ | ||
45 | - udhcp_run_script(NULL, "deconfig"); | ||
46 | + if (allow_deconfig) | ||
47 | + udhcp_run_script(NULL, "deconfig"); | ||
48 | } | ||
49 | bb_info_msg("Entering released state"); | ||
50 | |||
51 | @@ -836,6 +841,7 @@ | ||
52 | OPT_o = 1 << 17, | ||
53 | OPT_x = 1 << 18, | ||
54 | OPT_f = 1 << 19, | ||
55 | + OPT_D = 1 << 20, | ||
56 | /* The rest has variable bit positions, need to be clever */ | ||
57 | OPTBIT_f = 20, | ||
58 | USE_FOR_MMU( OPTBIT_b,) | ||
59 | @@ -861,7 +867,7 @@ | ||
60 | #endif | ||
61 | ; | ||
62 | IF_LONG_OPTS(applet_long_options = udhcpc_longopts;) | ||
63 | - opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:f" | ||
64 | + opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fD" | ||
65 | USE_FOR_MMU("b") | ||
66 | IF_FEATURE_UDHCPC_ARPING("a") | ||
67 | IF_FEATURE_UDHCP_PORT("P:") | ||
68 | @@ -950,6 +956,9 @@ | ||
69 | logmode |= LOGMODE_SYSLOG; | ||
70 | } | ||
71 | |||
72 | + if (opt & OPT_D) | ||
73 | + allow_deconfig = 0; | ||
74 | + | ||
75 | /* Make sure fd 0,1,2 are open */ | ||
76 | bb_sanitize_stdio(); | ||
77 | /* Equivalent of doing a fflush after every \n */ | ||
78 | @@ -964,7 +973,8 @@ | ||
79 | srand(monotonic_us()); | ||
80 | |||
81 | state = INIT_SELECTING; | ||
82 | - udhcp_run_script(NULL, "deconfig"); | ||
83 | + if (allow_deconfig) | ||
84 | + udhcp_run_script(NULL, "deconfig"); | ||
85 | change_listen_mode(LISTEN_RAW); | ||
86 | packet_num = 0; | ||
87 | timeout = 0; | ||
88 | @@ -1100,7 +1110,8 @@ | ||
89 | } | ||
90 | /* Timed out, enter init state */ | ||
91 | bb_info_msg("Lease lost, entering init state"); | ||
92 | - udhcp_run_script(NULL, "deconfig"); | ||
93 | + if (allow_deconfig) | ||
94 | + udhcp_run_script(NULL, "deconfig"); | ||
95 | state = INIT_SELECTING; | ||
96 | /*timeout = 0; - already is */ | ||
97 | packet_num = 0; | ||
98 | @@ -1246,7 +1257,8 @@ | ||
99 | send_decline(xid, server_addr, packet.yiaddr); | ||
100 | |||
101 | if (state != REQUESTING) | ||
102 | - udhcp_run_script(NULL, "deconfig"); | ||
103 | + if (allow_deconfig) | ||
104 | + udhcp_run_script(NULL, "deconfig"); | ||
105 | change_listen_mode(LISTEN_RAW); | ||
106 | state = INIT_SELECTING; | ||
107 | requested_ip = 0; | ||
108 | @@ -1292,7 +1304,8 @@ | ||
109 | bb_info_msg("Received DHCP NAK"); | ||
110 | udhcp_run_script(&packet, "nak"); | ||
111 | if (state != REQUESTING) | ||
112 | - udhcp_run_script(NULL, "deconfig"); | ||
113 | + if (allow_deconfig) | ||
114 | + udhcp_run_script(NULL, "deconfig"); | ||
115 | change_listen_mode(LISTEN_RAW); | ||
116 | sleep(3); /* avoid excessive network traffic */ | ||
117 | state = INIT_SELECTING; | ||