From: Antonio Huete Jimenez Date: Sat, 4 Aug 2012 19:05:11 +0000 (+0200) Subject: dhclient - Set state to S_REBOOTING when calling state_reboot(). X-Git-Tag: v3.2.0~322 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/2cfe4a05b6a29de280735ec27469850c68bca8c3?ds=sidebyside dhclient - Set state to S_REBOOTING when calling state_reboot(). - Also set state inside state_reboot() to S_INIT when calling state_init(). Rather than the other way around. Makes for more consistant idiom and might reduce state confusion. Taken-from: OpenBSD --- diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index e956f5e1c2..3df23eaffb 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: src/sbin/dhclient/dhclient.c,v 1.143 2012/06/20 21:53:51 kettenis Exp $ */ +/* $OpenBSD: src/sbin/dhclient/dhclient.c,v 1.144 2012/06/22 00:08:43 krw Exp $ */ /* * Copyright 2004 Henning Brauer @@ -242,7 +242,7 @@ routehandler(void) #endif ifi->linkstat = interface_link_status(ifi->name); if (ifi->linkstat) { - client->state = S_INIT; + client->state = S_REBOOTING; state_reboot(); } } @@ -401,7 +401,7 @@ main(int argc, char *argv[]) setproctitle("%s", ifi->name); if (ifi->linkstat) { - client->state = S_INIT; + client->state = S_REBOOTING; state_reboot(); } else go_daemon(); @@ -462,13 +462,11 @@ state_reboot(void) /* If we don't remember an active lease, go straight to INIT. */ if (!client->active || client->active->is_bootp) { + client->state = S_INIT; state_init(); return; } - /* We are in the rebooting state. */ - client->state = S_REBOOTING; - /* make_request doesn't initialize xid because it normally comes from the DHCPDISCOVER, but we haven't sent a DHCPDISCOVER, so pick an xid now. */