diff --git a/src/ipv4ll.c b/src/ipv4ll.c index 86cc227d..89b3dce6 100644 --- a/src/ipv4ll.c +++ b/src/ipv4ll.c @@ -335,6 +335,10 @@ ipv4ll_start(void *arg) } } + if (state->running) + return; + state->running = true; + /* RFC 3927 Section 2.1 states that the random number generator * SHOULD be seeded with a value derived from persistent information * such as the IEEE 802 MAC address so that it usually picks @@ -435,11 +439,14 @@ ipv4ll_drop(struct interface *ifp) return; state = IPV4LL_STATE(ifp); - if (state && state->addr != NULL) { - if (ifp->options->options & DHCPCD_CONFIGURE) - ipv4_deladdr(state->addr, 1); - state->addr = NULL; - dropped = true; + if (state) { + state->running = false; + if (state->addr != NULL) { + if (ifp->options->options & DHCPCD_CONFIGURE) + ipv4_deladdr(state->addr, 1); + state->addr = NULL; + dropped = true; + } } /* Free any other link local addresses that might exist. */ diff --git a/src/ipv4ll.h b/src/ipv4ll.h index f9e05982..78af32e5 100644 --- a/src/ipv4ll.h +++ b/src/ipv4ll.h @@ -44,6 +44,7 @@ struct ipv4ll_state { struct in_addr pickedaddr; struct ipv4_addr *addr; char randomstate[128]; + bool running; bool seeded; bool down; size_t conflicts;