}
void
-dhcp_reboot(struct interface *ifp, int oldopts)
+dhcp_reboot_newopts(struct interface *ifp, int oldopts)
{
struct if_options *ifo = ifp->options;
struct dhcp_state *state = D_STATE(ifp);
if (state == NULL)
return;
ifo = ifp->options;
- state->interval = 0;
if ((ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC) &&
state->addr.s_addr != ifo->req_addr.s_addr) ||
(oldopts & (DHCPCD_INFORM | DHCPCD_STATIC) &&
!(ifo->options & (DHCPCD_INFORM | DHCPCD_STATIC))))
{
dhcp_drop(ifp, "EXPIRE");
- } else {
- free(state->offer);
- state->offer = NULL;
}
+}
+
+static void
+dhcp_reboot(struct interface *ifp)
+{
+ struct if_options *ifo = ifp->options;
+ struct dhcp_state *state = D_STATE(ifp);
+
+ if (state == NULL)
+ return;
+ ifo = ifp->options;
+ state->interval = 0;
if (ifo->options & DHCPCD_LINK && ifp->carrier == LINK_DOWN) {
syslog(LOG_INFO, "%s: waiting for carrier", ifp->name);
ifp->options->options & DHCPCD_IPV4LL)
ipv4ll_start(ifp);
else
- dhcp_reboot(ifp, ifp->options->options);
+ dhcp_reboot(ifp);
}
void dhcp_inform(struct interface *);
void dhcp_release(struct interface *);
void dhcp_bind(void *);
-void dhcp_reboot(struct interface *, int);
+void dhcp_reboot_newopts(struct interface *, int);
void dhcp_close(struct interface *);
void dhcp_free(struct interface *);
int dhcp_dump(const char *);
oldopts = ifp->options->options;
configure_interface(ifp, argc, argv);
- dhcp_reboot(ifp, oldopts);
+ dhcp_reboot_newopts(ifp, oldopts);
start_interface(ifp);
}
break;
case SIGALRM:
syslog(LOG_INFO, "received SIGALRM, rebinding");
- /* We shouldn't modify any variables in the signal
- * handler, so simply add reboot function to the queue
- * for an immediate callout. */
eloop_timeout_add_now(sig_reboot, NULL);
return;
case SIGHUP: