I understand that when you use the -n option to udhcpc, it will quit
if it's not able to immediately get an IP address.  What isn't
apparent though, is that if the initial request succeeds, but a
subsquent renew fails to get an IP address, udhcpc will also quit.
For me at least, this was unexpected, since the --help description
only mentions changing the initial behavior and doesn't say anything
about changing renew behavior.  The following patch makes things work
like I was expecting.  Feel free to ignore this if it's supposed to
work this way. :)

-Justin

--- busybox-1.14.3/networking/udhcp/dhcpc.c     Sun Aug  2 18:16:36 2009
+++ busybox-1.14.3-new/networking/udhcp/dhcpc.c Wed Aug 12 16:53:16 2009
@@ -587,6 +587,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c

                                       state = BOUND;
                                       change_listen_mode(LISTEN_NONE);
+                                       opt &= ~OPT_n; /* JM - don't
quit if a future renew fails */
                                       if (opt & OPT_q) { /* quit after lease */
                                               if (opt & OPT_R) /*
release on quit */

perform_release(requested_ip, server_addr);
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to