From 5bb71d3e5b11a3066a93be33c20320823636ae80 Mon Sep 17 00:00:00 2001 From: Antonio Huete Jimenez Date: Wed, 15 Aug 2012 03:19:51 +0200 Subject: [PATCH] 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 --- sbin/dhclient/dispatch.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 2.41.0