package/busybox: Fix check for IPv6 default route in udhcpc
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Tue, 2 Feb 2021 01:54:52 +0000 (17:54 -0800)
committerPeter Korsgaard <peter@korsgaard.com>
Tue, 2 Feb 2021 15:35:56 +0000 (16:35 +0100)
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@gmail.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/busybox/udhcpc.script

index ec4d9f6185d95449603abf255c583d384a2a851f..c73ad6c2efcec83b070442865b6a49dd69639889 100755 (executable)
@@ -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