dhclient - Assume link is up when IFM_AVALID isn't set.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Wed, 15 Aug 2012 01:19:51 +0000 (03:19 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Sun, 19 Aug 2012 14:31:01 +0000 (16:31 +0200)
- 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

index e199159..9cf4a77 100644 (file)
@@ -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