summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-07-26 18:42:59 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-07-26 18:42:59 +0000
commitc3bb229d64a182ee751128b04cd8807a98a0ef06 (patch)
tree23ad44a1029d15a4eba031b324201250db8e9374 /sbin
parentdc714d9f5a363ee044b0e5269679d1a3d13faa75 (diff)
Make interface_status() assume that a link is up when IFM_AVALID
is not set. This is what the late interface_link_status() did. Allows drivers who cannot tell what the link state is to get dhcp leases. Prodding by henning@. ok deraadt@ miod@
Diffstat (limited to 'sbin')
-rw-r--r--sbin/dhclient/dispatch.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index 399da2f249f..1ca9fa84e8e 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.52 2012/07/09 16:21:21 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.53 2012/07/26 18:42:58 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -301,12 +301,15 @@ interface_status(char *ifname)
else
goto inactive;
}
-inactive:
- close(sock);
- return (0);
+
+ /* Assume 'active' if IFM_AVALID is not set. */
+
active:
close(sock);
return (1);
+inactive:
+ close(sock);
+ return (0);
}
void