diff options
author | 2012-06-22 00:08:43 +0000 | |
---|---|---|
committer | 2012-06-22 00:08:43 +0000 | |
commit | ea65dadbb3af41e24a0df2131bd11f90f6fb2852 (patch) | |
tree | ed75e2249ca5d1ec4a59ce1c7c86bd65a11b4862 | |
parent | rfc 3542 obsoletes rfc 2292; ok guenther (diff) | |
download | wireguard-openbsd-ea65dadbb3af41e24a0df2131bd11f90f6fb2852.tar.xz wireguard-openbsd-ea65dadbb3af41e24a0df2131bd11f90f6fb2852.zip |
Set state to S_REBOOTING when calling state_reboot() and 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.
-rw-r--r-- | sbin/dhclient/dhclient.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index b494467efe0..3a1c03ecaea 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.143 2012/06/20 21:53:51 kettenis Exp $ */ +/* $OpenBSD: dhclient.c,v 1.144 2012/06/22 00:08:43 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -244,7 +244,7 @@ routehandler(void) #endif ifi->linkstat = interface_link_status(ifi->name); if (ifi->linkstat) { - client->state = S_INIT; + client->state = S_REBOOTING; state_reboot(); } } @@ -415,7 +415,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(); @@ -478,13 +478,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. */ |