]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Check carrier eariler. Thanks to Michael Olney.
authorRoy Marples <roy@marples.name>
Tue, 24 Feb 2009 00:02:41 +0000 (00:02 +0000)
committerRoy Marples <roy@marples.name>
Tue, 24 Feb 2009 00:02:41 +0000 (00:02 +0000)
client.c

index 11b529f02187efe74ecc76c38cbe3690f9965575..d14bd751aa0caf7d7f369bf6576af71562d0b71a 100644 (file)
--- a/client.c
+++ b/client.c
@@ -1261,6 +1261,8 @@ handle_timeout(struct if_state *state, const struct options *options)
                timerclear(&state->stop);
                /* FALLTHROUGH */
        case STATE_INIT:
+               if (state->carrier == LINK_DOWN)
+                       return 0;
                do_socket(state, SOCKET_OPEN);
                state->xid = arc4random();
                iface->start_uptime = uptime();
@@ -1284,8 +1286,6 @@ handle_timeout(struct if_state *state, const struct options *options)
                }
                /* FALLTHROUGH */
        case STATE_INIT:
-               if (state->carrier == LINK_DOWN)
-                       return 0;
                if (lease->addr.s_addr == 0 ||
                    IN_LINKLOCAL(ntohl(iface->addr.s_addr)))
                {