blob: 948932a3e8927f93e6420614fdf0f2a7dc05eb25 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 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---
Brad Bishop316dfdd2018-06-25 12:45:53 -040031 networking/udhcp/dhcpc.c | 29 ++++++++++++++++------
32 1 file changed, 21 insertions(+), 8 deletions(-)
Patrick Williamsc124f4f2015-09-15 14:41:29 -050033
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050034Index: busybox-1.34.0/networking/udhcp/dhcpc.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -050035===================================================================
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050036--- busybox-1.34.0.orig/networking/udhcp/dhcpc.c
37+++ busybox-1.34.0/networking/udhcp/dhcpc.c
38@@ -48,6 +48,8 @@
Brad Bishop316dfdd2018-06-25 12:45:53 -040039 };
40 #endif
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041
42+/* option whether to down the interface when reconfiguring */
43+static int allow_deconfig = 1;
Brad Bishop316dfdd2018-06-25 12:45:53 -040044
Brad Bishop96ff1982019-08-19 13:50:42 -040045 /* "struct client_data_t client_data" is in bb_common_bufsiz1 */
Patrick Williamsc124f4f2015-09-15 14:41:29 -050046
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050047@@ -100,8 +102,10 @@
48 OPT_x = 1 << 16,
49 OPT_f = 1 << 17,
50 OPT_B = 1 << 18,
51+ OPT_D = 1 << 19,
Patrick Williamsc124f4f2015-09-15 14:41:29 -050052 /* The rest has variable bit positions, need to be clever */
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050053 OPTBIT_B = 18,
54+ OPTBIT_D = 19,
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055 USE_FOR_MMU( OPTBIT_b,)
56 IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
57 IF_FEATURE_UDHCP_PORT( OPTBIT_P,)
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050058@@ -587,7 +591,8 @@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050060 static void d4_run_script_deconfig(void)
61 {
62- d4_run_script(NULL, "deconfig");
63+ if (allow_deconfig)
64+ d4_run_script(NULL, "deconfig");
65 }
66
67 /*** Sending/receiving packets ***/
68@@ -1244,7 +1249,7 @@
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080069 /* Parse command line */
70 opt = getopt32long(argv, "^"
71 /* O,x: list; -T,-t,-A take numeric param */
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050072- "CV:F:i:np:qRr:s:T:+t:+SA:+O:*ox:*fB"
73+ "CV:F:i:np:qRr:s:T:+t:+SA:+O:*ox:*fBD"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074 USE_FOR_MMU("b")
Brad Bishop316dfdd2018-06-25 12:45:53 -040075 IF_FEATURE_UDHCPC_ARPING("a::")
Patrick Williamsc124f4f2015-09-15 14:41:29 -050076 IF_FEATURE_UDHCP_PORT("P:")
Andrew Geisslerd159c7f2021-09-02 21:05:58 -050077@@ -1361,6 +1366,10 @@
Patrick Williamsc124f4f2015-09-15 14:41:29 -050078 logmode |= LOGMODE_SYSLOG;
79 }
80
Brad Bishop316dfdd2018-06-25 12:45:53 -040081+ if (opt & OPT_D) {
Patrick Williamsc124f4f2015-09-15 14:41:29 -050082+ allow_deconfig = 0;
Brad Bishop316dfdd2018-06-25 12:45:53 -040083+ }
Patrick Williamsc124f4f2015-09-15 14:41:29 -050084+
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080085 /* Create pidfile */
Brad Bishop96ff1982019-08-19 13:50:42 -040086 write_pidfile(client_data.pidfile);
87 /* Goes to stdout (unless NOMMU) and possibly syslog */