astate->iface->name, inet_ntoa(astate->addr));
if (state->state != DHS_INFORM)
dhcp_bind(astate->iface);
+#ifndef IN_IFF_TENTATIVE
+ else {
+ struct dhcp_message *oldnew;
+
+ oldnew = state->new;
+ state->new = state->offer;
+ get_lease(astate->iface->ctx, &state->lease, state->new);
+ ipv4_applyaddr(astate->iface);
+ state->new = oldnew;
+ }
+#endif
+
arp_announce(astate);
/* Stop IPv4LL now we have a working DHCP address */
ipv4ll_drop(astate->iface);
+
+ if (ifo->options & DHCPCD_INFORM)
+ dhcp_inform(astate->iface);
}
static void
struct dhcp_lease l;
get_lease(ifp->ctx, &l, state->offer);
- logger(ifp->ctx, LOG_INFO, "%s: probing static address %s/%d",
+ logger(ifp->ctx, LOG_INFO, "%s: probing address %s/%d",
ifp->name, inet_ntoa(l.addr), inet_ntocidr(l.net));
if ((astate = arp_new(ifp, &addr)) != NULL) {
astate->probed_cb = dhcp_arp_probed;
state = D_STATE(ifp);
ifo = ifp->options;
+ state->state = DHS_INFORM;
free(state->offer);
state->offer = NULL;
state->offer = dhcp_message_new(&ia->addr, &ia->net);
if (state->offer) {
- state->state = DHS_INFORM;
state->xid = dhcp_xid(ifp);
get_lease(ifp->ctx, &state->lease, state->offer);
send_inform(ifp);
* notification right now via our link socket. */
if_initrt(ifp);
ipv4_buildroutes(ifp->ctx);
- script_runreason(ifp, state->reason);
-
- dhcpcd_daemonise(ifp->ctx);
+ if (state->state == DHS_BOUND) {
+ script_runreason(ifp, state->reason);
+ dhcpcd_daemonise(ifp->ctx);
+ }
}
void
}
}
- dhcp_handleifa(cmd, ifp, addr, net, dst, flags);
arp_handleifa(cmd, ifp, addr, flags);
+ dhcp_handleifa(cmd, ifp, addr, net, dst, flags);
}
void