kern/97329: code simplification
David Rhodus
drhodus at machdep.com
Tue May 16 01:10:16 UTC 2006
>Number: 97329
>Category: kern
>Synopsis: 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:
>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:
>Unformatted:
More information about the freebsd-bugs
mailing list