Hello, erik quanstrom wrote: |email | quanstro@quanstro.net |readme | don't dhcp by default. it looks like a hang. [.] |+ #if(! test -e /net/ipifc/0/ctl || ~ 127.0.0.1 `{cat /net/ipifc/0/local}) |+ # ip/ipconfig >/dev/null >[2=1] [.] after looking into the ipconfig source and placing some fprint() the actual "hang" is caused by a faulty length of the sleep. If i add --- a/sys/src/cmd/ip/ipconfig/main.c +++ b/sys/src/cmd/ip/ipconfig/main.c @@ -469,6 +469,12 @@ main(int argc, char **argv) int retry, action; Ctl *cp; + for (retry = 0; retry < 10; ++retry) { + long t = time(nil); + fprint(2, "retry %d, time %ld\n", retry, t); + sleep(1000); + } + init(); retry = 0; ARGBEGIN { then each tick sleeps ~1 second (sometimes a tick needed 3 in the tests i've done). But if i add --- a/sys/src/cmd/ip/ipconfig/main.c +++ b/sys/src/cmd/ip/ipconfig/main.c @@ -621,10 +621,13 @@ doadd(int retry) if(dodhcp){ mkclientid(); for(tries = 0; tries < 30; tries++){ + long t; dhcpquery(!noconfig, Sselecting); if(conf.state == Sbound) break; sleep(1000); + t = time(nil); + fprint(2, "retry %d, time %ld\n", tries, t); } } then that sleep takes reproducably 12 seconds. Without having any ideas what this could be about (VirtualBox?), i nonetheless wonder wether something like this would be imaginable, since a time difference is used later on in the code, too: --- a/sys/src/cmd/ip/ipconfig/main.c +++ b/sys/src/cmd/ip/ipconfig/main.c @@ -619,12 +619,15 @@ doadd(int retry) /* run dhcp if we need something */ if(dodhcp){ + long start = time(nil); mkclientid(); for(tries = 0; tries < 30; tries++){ dhcpquery(!noconfig, Sselecting); if(conf.state == Sbound) break; sleep(1000); + if (tries > 1 && time(nil) - start > 30) + break; } } Apologies for the patch format (it's all half-baked here). --steffen