summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-06-22 00:08:44 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-06-22 00:08:44 +0000
commit44b834ac17ad6926735b8ccfa83387b8ea1808a5 (patch)
tree5c6b74d0bf0c870051f9a93eebb508d51294c8ce /sbin
parent99c54494a0e43b3cca940547ab5447a38e68d2fa (diff)
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.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dhclient.c10
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. */