udhcpc: fix bug 629: use bcast receive when we perform rebinding
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Oct 2009 21:05:46 +0000 (23:05 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 8 Oct 2009 21:05:46 +0000 (23:05 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/udhcp/dhcpc.c

index ccc0393f211ef93809a9dc2aaa50abb515699f51..9a2fe35e4d169e0b03047cef61e441d4ea4f46c9 100644 (file)
@@ -451,6 +451,8 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
                                state = REBINDING;
                                /* fall right through */
                        case REBINDING:
+                               /* Switch to bcast receive */
+                               change_listen_mode(LISTEN_RAW);
                                /* Lease is *really* about to run out,
                                 * try to find DHCP server using broadcast */
                                if (timeout > 0) {
@@ -462,7 +464,6 @@ int udhcpc_main(int argc UNUSED_PARAM, char **argv)
                                /* Timed out, enter init state */
                                bb_info_msg("Lease lost, entering init state");
                                udhcp_run_script(NULL, "deconfig");
-                               change_listen_mode(LISTEN_RAW);
                                state = INIT_SELECTING;
                                /*timeout = 0; - already is */
                                packet_num = 0;