[Buildroot] [git commit branch/2020.11.x] package/busybox: Fix check for IPv6 default route in udhcpc

Peter Korsgaard peter at korsgaard.com
Wed Feb 3 19:29:45 UTC 2021


commit: https://git.buildroot.net/buildroot/commit/?id=efca26a4051372112c03c326642a74f2981639a3
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/2020.11.x

The check for a default route is inverted, causing the script to wait
for the timeout even when a default IPv6 route is available. Fix this up
so that it exits early as expected.

Reported-by: Bhattiprolu RaviKumar <ravikumar.bhattiprolu at gmail.com>
Signed-off-by: Samuel Mendoza-Jonas <sam at mendozajonas.com>
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
(cherry picked from commit 09ad6f392fca86dc220f0ba3129512ab4f3469e1)
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/busybox/udhcpc.script | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/busybox/udhcpc.script b/package/busybox/udhcpc.script
index ec4d9f6185..c73ad6c2ef 100755
--- a/package/busybox/udhcpc.script
+++ b/package/busybox/udhcpc.script
@@ -18,7 +18,7 @@ fi
 wait_for_ipv6_default_route() {
 	printf "Waiting for IPv6 default route to appear"
 	while [ $IF_WAIT_DELAY -gt 0 ]; do
-		if [ -z "$(ip -6 route list | grep default)" ]; then
+		if ip -6 route list | grep -q default; then
 			printf "\n"
 			return
 		fi


More information about the buildroot mailing list