From: Ted Lemon Date: Thu, 6 Mar 1997 07:06:08 +0000 (+0000) Subject: Traversal of interface list to weed out bad interfaces was broken when I added the... X-Git-Tag: DHCP-970306~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c800b2aa41c0a3c3a768d3acf596f175709e92f6;p=thirdparty%2Fdhcp.git Traversal of interface list to weed out bad interfaces was broken when I added the dummy interface list - fix is to save the next pointer before weeding out interfaces. --- diff --git a/common/dispatch.c b/common/dispatch.c index 3ae4c0125..f0adbee43 100644 --- a/common/dispatch.c +++ b/common/dispatch.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: dispatch.c,v 1.36 1997/03/06 06:52:30 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dispatch.c,v 1.37 1997/03/06 07:06:08 mellon Exp $ Copyright (c) 1995, 1996 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -68,7 +68,7 @@ void discover_interfaces (state) int state; { struct interface_info *tmp; - struct interface_info *last; + struct interface_info *last, *next; char buf [8192]; struct ifconf ic; struct ifreq ifr; @@ -292,7 +292,8 @@ void discover_interfaces (state) /* Weed out the interfaces that did not have IP addresses. */ last = (struct interface_info *)0; - for (tmp = interfaces; tmp; tmp = tmp -> next) { + for (tmp = interfaces; tmp; tmp = next) { + next = tmp -> next; if (!tmp -> ifp || !(tmp -> flags & INTERFACE_REQUESTED)) { if ((tmp -> flags & INTERFACE_REQUESTED) != ir) error ("%s: not found", tmp -> name);