From: kn Date: Mon, 3 Jul 2023 15:52:51 +0000 (+0000) Subject: use consistent queue(9) example for LIST removal; OK bluhm mvs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=63832deb675b8aedf0c8923a1c3c92e2adcdffe7;p=openbsd use consistent queue(9) example for LIST removal; OK bluhm mvs --- 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); }