summaryrefslogtreecommitdiff
path: root/aports/busybox/0021-udhcpc-Don-t-background-if-n-is-given.patch
diff options
context:
space:
mode:
authorPÁLI Gábor János <pali.gabor@gmail.com>2023-08-03 10:10:44 +0200
committerPÁLI Gábor János <pali.gabor@gmail.com>2023-09-16 17:58:03 +0200
commit89279d87c5d3e0ea330be1f927e3f3bc59dbc2a7 (patch)
tree353bc9a026d0140151e760efbc4f6a6a6b24a020 /aports/busybox/0021-udhcpc-Don-t-background-if-n-is-given.patch
parent084335e136581edc28137b152cc559778224570e (diff)
downloadfreebsd-wifibox-alpine-89279d87c5d3e0ea330be1f927e3f3bc59dbc2a7.zip
Update to Linux 6.1 and Alpine 3.18
- Update base-layout to 3.4.3 - Update busybox to 1.36.1 - Update iptables to 1.8.9 - Update linux-lts to 6.1.53 - Update to openrc to 0.48 - Update rtl8821ce to snapshot of 20230915 - Replace rtwB88 with a third-party driver - Update rtw89 to snapshot of 20230913 - Import wpa_supplicant fixes from Arch Linux
Diffstat (limited to 'aports/busybox/0021-udhcpc-Don-t-background-if-n-is-given.patch')
-rw-r--r--aports/busybox/0021-udhcpc-Don-t-background-if-n-is-given.patch100
1 files changed, 100 insertions, 0 deletions
diff --git a/aports/busybox/0021-udhcpc-Don-t-background-if-n-is-given.patch b/aports/busybox/0021-udhcpc-Don-t-background-if-n-is-given.patch
new file mode 100644
index 0000000..9ce7adf
--- /dev/null
+++ b/aports/busybox/0021-udhcpc-Don-t-background-if-n-is-given.patch
@@ -0,0 +1,100 @@
+From b6a7520ce7c77f14f61794e6a84c865042a31db3 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 6 Jul 2017 07:05:15 +0200
+Subject: [PATCH] udhcpc: Don't background if -n is given
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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.
+
+Since busybox 1.31.0 -b takes precedence over -n [0]. However, since we
+enable -b instead of -n by default (through our busyboxconfig) this is
+not desired, this commit therefore also reverts the upstream patch
+introducing this change.
+
+See also: https://bugs.busybox.net/11691
+
+[0]: https://git.busybox.net/busybox/commit/?id=87e216294af9eec39c0c1d553555f8a98c15db38
+
+---
+ networking/udhcp/d6_dhcpc.c | 20 +++++++-------------
+ networking/udhcp/dhcpc.c | 20 +++++++-------------
+ 2 files changed, 14 insertions(+), 26 deletions(-)
+
+diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c
+index 3d0ec98f9..cc3afa921 100644
+--- a/networking/udhcp/d6_dhcpc.c
++++ b/networking/udhcp/d6_dhcpc.c
+@@ -1403,25 +1403,19 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv)
+ leasefail:
+ change_listen_mode(LISTEN_NONE);
+ d6_run_script_no_option("leasefail");
++ if (opt & OPT_n) { /* abort if no lease */
++ bb_simple_info_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_simple_info_msg("no lease, forking to background");
+ client_background();
+ /* do not background again! */
+- opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f);
+- /* ^^^ also disables -n (-b takes priority over -n):
+- * ifup's default udhcpc options are -R -n,
+- * and users want to be able to add -b
+- * (in a config file) to make it background
+- * _and not exit_.
+- */
+- } else
+-#endif
+- if (opt & OPT_n) { /* abort if no lease */
+- bb_simple_info_msg("no lease, failing");
+- retval = 1;
+- goto ret;
++ opt = ((opt & ~OPT_b) | OPT_f);
+ }
++#endif
+ /* Wait before trying again */
+ timeout = tryagain_timeout;
+ packet_num = 0;
+diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c
+index 424d6dade..06ad59fe5 100644
+--- a/networking/udhcp/dhcpc.c
++++ b/networking/udhcp/dhcpc.c
+@@ -1456,25 +1456,19 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
+ leasefail:
+ change_listen_mode(LISTEN_NONE);
+ d4_run_script(NULL, "leasefail");
++ if (opt & OPT_n) { /* abort if no lease */
++ bb_simple_info_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_simple_info_msg("no lease, forking to background");
+ client_background();
+ /* do not background again! */
+- opt = ((opt & ~(OPT_b|OPT_n)) | OPT_f);
+- /* ^^^ also disables -n (-b takes priority over -n):
+- * ifup's default udhcpc options are -R -n,
+- * and users want to be able to add -b
+- * (in a config file) to make it background
+- * _and not exit_.
+- */
+- } else
+-#endif
+- if (opt & OPT_n) { /* abort if no lease */
+- bb_simple_info_msg("no lease, failing");
+- retval = 1;
+- goto ret;
++ opt = ((opt & ~OPT_b) | OPT_f);
+ }
++#endif
+ /* Wait before trying again */
+ timeout = tryagain_timeout;
+ packet_num = 0;