From nobody@FreeBSD.org  Tue May 16 01:01:25 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 9F89A16A53E
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 May 2006 01:01:25 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6DABE43D46
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 May 2006 01:01:25 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k4G11Pa6034587
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 16 May 2006 01:01:25 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k4G11PTY034586;
	Tue, 16 May 2006 01:01:25 GMT
	(envelope-from nobody)
Message-Id: <200605160101.k4G11PTY034586@www.freebsd.org>
Date: Tue, 16 May 2006 01:01:25 GMT
From: David Rhodus <drhodus@machdep.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: code simplification
X-Send-Pr-Version: www-2.3

>Number:         97329
>Category:       kern
>Synopsis:       [nfs] [patch] code simplification
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue May 16 01:10:15 GMT 2006
>Closed-Date:    
>Last-Modified:  Mon Feb 19 07:29:18 GMT 2007
>Originator:     David Rhodus
>Release:        7.0
>Organization:
>Environment:
>Description:
Index: bootp_subr.c
===================================================================
RCS file: /usr/ncvs/src/sys/nfsclient/bootp_subr.c,v
retrieving revision 1.64
diff -u -r1.64 bootp_subr.c
--- bootp_subr.c        26 Apr 2005 20:45:29 -0000      1.64
+++ bootp_subr.c        10 May 2006 13:36:03 -0000
@@ -397,12 +397,8 @@
 
        printf("Interface list:\n");
        IFNET_RLOCK(); /* could sleep, but okay for debugging XXX */
-       for (ifp = TAILQ_FIRST(&ifnet);
-            ifp != NULL;
-            ifp = TAILQ_NEXT(ifp, if_link)) {
-               for (ifa = TAILQ_FIRST(&ifp->if_addrhead);
-                    ifa != NULL;
-                    ifa = TAILQ_NEXT(ifa, ifa_link))
+       TAILQ_FOREACH(ifp, &ifnet, if_link) {
+               TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link)
                        if (ifa->ifa_addr->sa_family == AF_INET)
                                bootpboot_p_if(ifp, ifa);
        }
@@ -1047,9 +1043,7 @@
        /* Get HW address */
 
        sdl = NULL;
-       for (ifa = TAILQ_FIRST(&ifctx->ifp->if_addrhead);
-            ifa != NULL;
-            ifa = TAILQ_NEXT(ifa, ifa_link))
+       TAILQ_FOREACH(ifa, &ifctx->ifp->if_addrhead, ifa_link)
                if (ifa->ifa_addr->sa_family == AF_LINK &&
                    (sdl = ((struct sockaddr_dl *) ifa->ifa_addr)) != NULL &&
                    sdl->sdl_type == IFT_ETHER)
@@ -1694,9 +1688,7 @@
 #endif
 
        IFNET_RLOCK();
-       for (ifp = TAILQ_FIRST(&ifnet), ifctx = gctx->interfaces;
-            ifp != NULL && ifctx != NULL;
-            ifp = TAILQ_NEXT(ifp, if_link)) {
+       TAILQ_FOREACH(ifp, &ifnet, if_link) {
                strlcpy(ifctx->ireq.ifr_name, ifp->if_xname,
                    sizeof(ifctx->ireq.ifr_name));
 #ifdef BOOTP_WIRED_TO

>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->matteo 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Tue May 16 11:49:08 UTC 2006 
Responsible-Changed-Why:  
I'll take care of this bug 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97329 
Responsible-Changed-From-To: matteo->freebsd-bugs 
Responsible-Changed-By: matteo 
Responsible-Changed-When: Mon Feb 19 07:27:48 UTC 2007 
Responsible-Changed-Why:  
Althought the change is simple and it applies and compile, I have no 
environment to test it, so reassign it to the pool 

http://www.freebsd.org/cgi/query-pr.cgi?pr=97329 
>Unformatted:
