diff options
author | Sören Tempel <soeren+git@soeren-tempel.net> | 2019-09-10 19:36:58 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2019-09-13 06:37:08 +0000 |
commit | 951faea8f556e37c7c488f31a1515d02d26f60eb (patch) | |
tree | 1178b2d80a4627174162d071d41fe7dee4914ec0 /main/busybox/0012-udhcpc-Don-t-background-if-n-is-given.patch | |
parent | 4c1ad5e179d37903440ff0d89fa9dcd5597b2caf (diff) | |
download | aports-951faea8f556e37c7c488f31a1515d02d26f60eb.tar.bz2 aports-951faea8f556e37c7c488f31a1515d02d26f60eb.tar.xz |
main/busybox: allow overwriting -b with udhcpc6 as well
The default alpine udhcp options are `-b -R` to allow users to overwrite
`-b` the `-n` flag takes precedence in alpine udhcpc. The same patch
has to be applied to udhcpc6 as well.
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.patch | 36 |
1 files changed, 27 insertions, 9 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 index f328779a8d..82bd1222ab 100644 --- 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 @@ -1,4 +1,4 @@ -From 36a09262a3a82407ddd8a789734dfde1e6d46bfa Mon Sep 17 00:00:00 2001 +From 8e43e4ad948c5db6144d49d8968d30dbfb4b5afb Mon Sep 17 00:00:00 2001 From: Natanael Copa <ncopa@alpinelinux.org> Date: Thu, 6 Jul 2017 13:39:15 +0200 Subject: [PATCH] udhcpc: Don't background if -n is given @@ -16,15 +16,25 @@ See also: https://bugs.busybox.net/11691 [0]: https://git.busybox.net/busybox/commit/?id=87e216294af9eec39c0c1d553555f8a98c15db38 --- - networking/udhcp/d6_dhcpc.c | 8 +------- + networking/udhcp/d6_dhcpc.c | 20 +++++++------------- networking/udhcp/dhcpc.c | 20 +++++++------------- - 2 files changed, 8 insertions(+), 20 deletions(-) + 2 files changed, 14 insertions(+), 26 deletions(-) diff --git a/networking/udhcp/d6_dhcpc.c b/networking/udhcp/d6_dhcpc.c -index 422b88882..dab9d33a0 100644 +index 422b88882..f09bdf617 100644 --- a/networking/udhcp/d6_dhcpc.c +++ b/networking/udhcp/d6_dhcpc.c -@@ -1365,13 +1365,7 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) +@@ -1360,25 +1360,19 @@ int udhcpc6_main(int argc UNUSED_PARAM, char **argv) + } + leasefail: + d6_run_script_no_option("leasefail"); ++ if (opt & OPT_n) { /* abort if no lease */ ++ bb_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_info_msg("no lease, forking to background"); client_background(); /* do not background again! */ @@ -35,12 +45,20 @@ index 422b88882..dab9d33a0 100644 - * (in a config file) to make it background - * _and not exit_. - */ +- } else +-#endif +- if (opt & OPT_n) { /* abort if no lease */ +- bb_info_msg("no lease, failing"); +- retval = 1; +- goto ret; + opt = ((opt & ~OPT_b) | OPT_f); - } else - #endif - if (opt & OPT_n) { /* abort if no lease */ + } ++#endif + /* wait before trying again */ + timeout = tryagain_timeout; + packet_num = 0; diff --git a/networking/udhcp/dhcpc.c b/networking/udhcp/dhcpc.c -index 739870bee..d09e2acca 100644 +index 95058dbd8..6501a1ba3 100644 --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c @@ -1478,25 +1478,19 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv) |