summaryrefslogtreecommitdiff
path: root/system/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-08 02:02:24 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-06-08 02:02:24 -0500
commitfd2bb2f751c13b3c0c002b8e012810902b9da364 (patch)
tree17b2e38c966c9f96cfa568c1f572261a289590e6 /system/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch
parentb0a5136bf3326ba38b360be288d06f9a27f2a4d2 (diff)
downloadpackages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.gz
packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.bz2
packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.tar.xz
packages-fd2bb2f751c13b3c0c002b8e012810902b9da364.zip
harmony -> system
Diffstat (limited to 'system/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch')
-rw-r--r--system/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/system/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch b/system/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch
new file mode 100644
index 000000000..75fe62dfd
--- /dev/null
+++ b/system/busybox/0010-udhcpc-Don-t-background-if-n-is-given.patch
@@ -0,0 +1,45 @@
+From a663349a9ae6d62bfad1243a8781fb254065b480 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 6 Jul 2017 13:39:15 +0200
+Subject: [PATCH 10/11] udhcpc: Don't background if -n is given
+
+we need add -b to our udhcpc options to prevent boot forever if there are no
+dhcp server. We also need a way for users to disable this behavior by making
+it possible to set -n option at runtime.
+---
+ networking/udhcp/dhcpc.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
+index 43aac1b85..bf53dd559 100644
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
+@@ -1504,19 +1504,19 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ }
+ leasefail:
+ udhcp_run_script(NULL, "leasefail");
++ if (opt & OPT_n) { /* abort if no lease */
++ bb_error_msg("no lease, failing");
++ retval = 1;
++ goto ret;
++ }
+ #if BB_MMU /* -b is not supported on NOMMU */
+ if (opt & OPT_b) { /* background if no lease */
+ bb_error_msg("no lease, forking to background");
+ client_background();
+ /* do not background again! */
+ opt = ((opt & ~OPT_b) | OPT_f);
+- } else
+-#endif
+- if (opt & OPT_n) { /* abort if no lease */
+- bb_error_msg("no lease, failing");
+- retval = 1;
+- goto ret;
+ }
++#endif
+ /* wait before trying again */
+ timeout = tryagain_timeout;
+ packet_num = 0;
+--
+2.13.2
+