[Buildroot] Question on udhcpc script

Samuel Mendoza-Jonas sam at mendozajonas.com
Tue Feb 2 01:33:44 UTC 2021


On Mon, 2021-02-01 at 14:56 +0100, Peter Korsgaard wrote:
> > > > > 
> The test indeed seems to be inverted. Samuel, any comments?

Only that I'm curious to know how this happened! I agree, that logic
looks inverted, the line could be simplified to something like

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

I can send a quick proper patch if you'd like.

Sam



More information about the buildroot mailing list