From 5c0ba9a1b99a60afa3bcbe52e045dd413a1e40e6 Mon Sep 17 00:00:00 2001 From: Ted Lemon Date: Wed, 11 Nov 1998 07:50:51 +0000 Subject: [PATCH] Allow non-broadcast interfaces to be specified on the command line. --- common/discover.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/common/discover.c b/common/discover.c index 81d06a20..a1699a4e 100644 --- a/common/discover.c +++ b/common/discover.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: discover.c,v 1.1 1998/11/06 00:19:56 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: discover.c,v 1.2 1998/11/11 07:50:51 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -139,22 +139,23 @@ void discover_interfaces (state) error ("Can't get interface flags for %s: %m", ifr.ifr_name); - /* Skip loopback, point-to-point and down interfaces, - except don't skip down interfaces if we're trying to - get a list of configurable interfaces. */ - if ((ifr.ifr_flags & IFF_LOOPBACK) || -#ifdef IFF_POINTOPOINT - (ifr.ifr_flags & IFF_POINTOPOINT) || -#endif - (!(ifr.ifr_flags & IFF_UP) && - state != DISCOVER_UNCONFIGURED)) - continue; - /* See if we've seen an interface that matches this one. */ for (tmp = interfaces; tmp; tmp = tmp -> next) if (!strcmp (tmp -> name, ifp -> ifr_name)) break; + /* Skip loopback, point-to-point and down interfaces, + except don't skip down interfaces if we're trying to + get a list of configurable interfaces. */ + if ((((ifr.ifr_flags & IFF_LOOPBACK) || +#ifdef IFF_POINTOPOINT + (ifr.ifr_flags & IFF_POINTOPOINT)) + && !tmp) || +#endif + (!(ifr.ifr_flags & IFF_UP) && + state != DISCOVER_UNCONFIGURED)) + continue; + /* If there isn't already an interface by this name, allocate one. */ if (!tmp) {