* [Buildroot] [git commit] package/busybox/udhcpc.script: ensure action argument is correctly passed to hook scripts
@ 2021-08-17 10:19 Peter Korsgaard
2021-09-04 21:02 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Peter Korsgaard @ 2021-08-17 10:19 UTC (permalink / raw)
To: buildroot
[-- Attachment #1: Type: text/plain, Size: 1563 bytes --]
commit: https://git.buildroot.net/buildroot/commit/?id=94c41eef615bb33ad26fff71d341f66e35286f5d
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
commit f79a420825479c47d (package/busybox/udhcpc.script: support RFC3442
static routes) used 'set --' clobbering the positional arguments, causing
the action argument to not be correctly forwarded to hook scripts for the
renew / bound cases if static routes are provided by the server.
As a workaround, save the action argument at the beginning of the script and
use that when calling hook scripts.
Reported-by: çç¦ <wangwangqi2011@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
package/busybox/udhcpc.script | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
index c73ad6c2ef..74dc5532b9 100755
--- a/package/busybox/udhcpc.script
+++ b/package/busybox/udhcpc.script
@@ -4,6 +4,7 @@
[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+ACTION="$1"
RESOLV_CONF="/etc/resolv.conf"
[ -e $RESOLV_CONF ] || touch $RESOLV_CONF
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
@@ -29,7 +30,7 @@ wait_for_ipv6_default_route() {
printf " timeout!\n"
}
-case "$1" in
+case "$ACTION" in
deconfig)
/sbin/ifconfig $interface up
/sbin/ifconfig $interface 0.0.0.0
@@ -115,7 +116,7 @@ esac
HOOK_DIR="$0.d"
for hook in "${HOOK_DIR}/"*; do
[ -f "${hook}" -a -x "${hook}" ] || continue
- "${hook}" "${@}"
+ "${hook}" "$ACTION"
done
exit 0
[-- Attachment #2: Type: text/plain, Size: 145 bytes --]
_______________________________________________
buildroot mailing list
buildroot@busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [git commit] package/busybox/udhcpc.script: ensure action argument is correctly passed to hook scripts
2021-08-17 10:19 [Buildroot] [git commit] package/busybox/udhcpc.script: ensure action argument is correctly passed to hook scripts Peter Korsgaard
@ 2021-09-04 21:02 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2021-09-04 21:02 UTC (permalink / raw)
To: buildroot
[-- Attachment #1: Type: text/plain, Size: 835 bytes --]
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
> commit: https://git.buildroot.net/buildroot/commit/?id=94c41eef615bb33ad26fff71d341f66e35286f5d
> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
> commit f79a420825479c47d (package/busybox/udhcpc.script: support RFC3442
> static routes) used 'set --' clobbering the positional arguments, causing
> the action argument to not be correctly forwarded to hook scripts for the
> renew / bound cases if static routes are provided by the server.
> As a workaround, save the action argument at the beginning of the script and
> use that when calling hook scripts.
> Reported-by: <wangwangqi2011@gmail.com>
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Committed to 2021.02.x and 2021.05.x, thanks.
--
Bye, Peter Korsgaard
[-- Attachment #2: Type: text/plain, Size: 156 bytes --]
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-04 21:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 10:19 [Buildroot] [git commit] package/busybox/udhcpc.script: ensure action argument is correctly passed to hook scripts Peter Korsgaard
2021-09-04 21:02 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.