diff options
author | Klemens Nanni <kn@cvs.openbsd.org> | 2023-07-03 15:52:52 +0000 |
---|---|---|
committer | Klemens Nanni <kn@cvs.openbsd.org> | 2023-07-03 15:52:52 +0000 |
commit | 020260819eeb1e59f209aeeb23fd0f7a751c0d87 (patch) | |
tree | d47f4962dba14b3e24117d89df0891747e8884f6 /sys/net | |
parent | 336444edb1c57b6ba3cf3a6ca83ceadebcfb6952 (diff) |
use consistent queue(9) example for LIST removal; OK bluhm mvs
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if_ethersubr.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index 584ee5582ec..4656fd8d2f8 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.288 2023/04/05 23:01:03 kn Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.289 2023/07/03 15:52:51 kn Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -709,9 +709,8 @@ ether_ifdetach(struct ifnet *ifp) /* Undo pseudo-driver changes. */ if_deactivate(ifp); - for (enm = LIST_FIRST(&ac->ac_multiaddrs); - enm != NULL; - enm = LIST_FIRST(&ac->ac_multiaddrs)) { + while (!LIST_EMPTY(&ac->ac_multiaddrs)) { + enm = LIST_FIRST(&ac->ac_multiaddrs); LIST_REMOVE(enm, enm_list); free(enm, M_IFMADDR, sizeof *enm); } |