From: Antonio Huete Jimenez Date: Wed, 15 Aug 2012 01:19:51 +0000 (+0200) Subject: dhclient - Assume link is up when IFM_AVALID isn't set. X-Git-Tag: v3.2.0~316 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/2de2b2fe24709cfd686b666f71b9da92cb4965fd?ds=sidebyside 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 --- diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index e199159ed0..9cf4a772f7 100644 --- a/sbin/dhclient/dispatch.c +++ b/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 @@ -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