Browse files

dhclient - Assume link is up when IFM_AVALID isn't set.

- This is what the late interface_link_status() did.
- Allows drivers who cannot tell what the link state is to get
  dhcp leases.

Taken-from: OpenBSD
  • Loading branch information...
1 parent 8d05e1a commit 2de2b2fe24709cfd686b666f71b9da92cb4965fd @tuxillo tuxillo committed Aug 15, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 sbin/dhclient/dispatch.c
View
11 sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: src/sbin/dhclient/dispatch.c,v 1.52 2012/07/09 16:21:21 krw Exp $ */
+/* $OpenBSD: src/sbin/dhclient/dispatch.c,v 1.53 2012/07/26 18:42:58 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -296,12 +296,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

0 comments on commit 2de2b2f

Please sign in to comment.