Use IFADDR_FOREACH
This commit is contained in:
parent
b6f0a6fc3d
commit
57295d2a01
@ -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 @@ if_deactivate(struct ifnet *ifp)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user