Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Use IFADDR_FOREACH



details:   https://anonhg.NetBSD.org/src/rev/128b78ef552e
branches:  trunk
changeset: 797812:128b78ef552e
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Jul 29 05:56:58 2014 +0000

description:
Use IFADDR_FOREACH

diffstat:

 sys/net/if.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 1d38edb6b168 -r 128b78ef552e sys/net/if.c
--- a/sys/net/if.c      Tue Jul 29 01:35:44 2014 +0000
+++ b/sys/net/if.c      Tue Jul 29 05:56:58 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.286 2014/07/28 14:24:48 ozaki-r Exp $ */
+/*     $NetBSD: if.c,v 1.287 2014/07/29 05:56:58 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.286 2014/07/28 14:24:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.287 2014/07/29 05:56:58 ozaki-r Exp $");
 
 #include "opt_inet.h"
 
@@ -690,10 +690,9 @@
 void
 if_purgeaddrs(struct ifnet *ifp, int family, void (*purgeaddr)(struct ifaddr *))
 {
-       struct ifaddr *ifa, *nifa;
+       struct ifaddr *ifa;
 
-       for (ifa = IFADDR_FIRST(ifp); ifa != NULL; ifa = nifa) {
-               nifa = IFADDR_NEXT(ifa);
+       IFADDR_FOREACH(ifa, ifp) {
                if (ifa->ifa_addr->sa_family != family)
                        continue;
                (*purgeaddr)(ifa);



Home | Main Index | Thread Index | Old Index