summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2006-08-31 10:12:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2006-08-31 10:12:19 +0000
commitc3ad20cb0ce003d97cefe235f267997d91310dce (patch)
tree39940c243de4e3a28002fad8a52e3cd51cf21fb5
parentc05cea1c3ebcefbd101738815cb5c0d2ebd6a7c3 (diff)
adjust link detection further: if no link, bring interface up and check
for link for 10 seconds. otherwise, if there was link, no problem! ok henning, claudio, tested by others
-rw-r--r--sbin/dhclient/dhclient.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index e640643c415..eaffe961b6c 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.87 2006/08/29 03:55:08 deraadt Exp $ */
+/* $OpenBSD: dhclient.c,v 1.88 2006/08/31 10:12:18 deraadt Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -243,7 +243,7 @@ die:
int
main(int argc, char *argv[])
{
- int ch, fd, quiet = 0, i = 0, pipe_fd[2], linkstat;
+ int ch, fd, quiet = 0, i = 0, pipe_fd[2];
extern char *__progname;
struct passwd *pw;
@@ -309,9 +309,9 @@ main(int argc, char *argv[])
read_client_conf();
- linkstat = interface_link_forceup(ifi->name);
-
if (!interface_link_status(ifi->name)) {
+ int linkstat = interface_link_forceup(ifi->name);
+
fprintf(stderr, "%s: no link ...", ifi->name);
if (ifi->client->config->link_timeout == 0) {
fprintf(stderr, " giving up\n");