summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2012-07-26 18:42:58 +0000
committerkrw <krw@openbsd.org>2012-07-26 18:42:58 +0000
commit08425660ba31ed3bbd136d62e54f9481d72e1368 (patch)
treeb9c052fc0a9d19f508d60500de7337fc51e2671f
parentremove reference to no longer existing description of nonexistent devices; (diff)
downloadwireguard-openbsd-08425660ba31ed3bbd136d62e54f9481d72e1368.tar.xz
wireguard-openbsd-08425660ba31ed3bbd136d62e54f9481d72e1368.zip
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@
-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