aboutsummaryrefslogtreecommitdiffstats
path: root/main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2018-03-06 16:54:09 +0100
committerSören Tempel <soeren+git@soeren-tempel.net>2018-03-11 14:27:25 +0100
commitdc6cfb7cebc64cdb278f02d32f897819bba5f983 (patch)
tree04cb1d5a44a1da6d2420fbfe2eaf6a5c0c728cb8 /main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch
parent4923b942bfc1889d3b2f3f6cb20b2aeef6a65f06 (diff)
downloadaports-dc6cfb7cebc64cdb278f02d32f897819bba5f983.tar.gz
aports-dc6cfb7cebc64cdb278f02d32f897819bba5f983.tar.bz2
aports-dc6cfb7cebc64cdb278f02d32f897819bba5f983.tar.xz
main/busybox: upgrade to 1.28.1
Diffstat (limited to 'main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch')
-rw-r--r--main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch b/main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch
new file mode 100644
index 0000000000..50719b0035
--- /dev/null
+++ b/main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch
@@ -0,0 +1,45 @@
+From 7f3d0620051c30e2047593092aa054565756b57f Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 6 Jul 2017 13:39:15 +0200
+Subject: [PATCH 12/16] 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 cc1d22c8e..10b846b0a 100644
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
+@@ -1479,19 +1479,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.16.2
+