xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
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 file changed, 21 insertions(+), 8 deletions(-)
33
34Index: busybox-1.34.0/networking/udhcp/dhcpc.c
35===================================================================
36--- busybox-1.34.0.orig/networking/udhcp/dhcpc.c
37+++ busybox-1.34.0/networking/udhcp/dhcpc.c
38@@ -48,6 +48,8 @@
39 };
40 #endif
41
42+/* option whether to down the interface when reconfiguring */
43+static int allow_deconfig = 1;
44
45 /* "struct client_data_t client_data" is in bb_common_bufsiz1 */
46
47@@ -100,8 +102,10 @@
48 	OPT_x = 1 << 16,
49 	OPT_f = 1 << 17,
50 	OPT_B = 1 << 18,
51+	OPT_D = 1 << 19,
52 /* The rest has variable bit positions, need to be clever */
53 	OPTBIT_B = 18,
54+	OPTBIT_D = 19,
55 	USE_FOR_MMU(             OPTBIT_b,)
56 	IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
57 	IF_FEATURE_UDHCP_PORT(   OPTBIT_P,)
58@@ -587,7 +591,8 @@
59
60 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 @@
69 	/* Parse command line */
70 	opt = getopt32long(argv, "^"
71 		/* O,x: list; -T,-t,-A take numeric param */
72-		"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"
74 		USE_FOR_MMU("b")
75 		IF_FEATURE_UDHCPC_ARPING("a::")
76 		IF_FEATURE_UDHCP_PORT("P:")
77@@ -1361,6 +1366,10 @@
78 		logmode |= LOGMODE_SYSLOG;
79 	}
80
81+	if (opt & OPT_D) {
82+		allow_deconfig = 0;
83+	}
84+
85 	/* Create pidfile */
86 	write_pidfile(client_data.pidfile);
87 	/* Goes to stdout (unless NOMMU) and possibly syslog */
88