From 63832deb675b8aedf0c8923a1c3c92e2adcdffe7 Mon Sep 17 00:00:00 2001 From: kn Date: Mon, 3 Jul 2023 15:52:51 +0000 Subject: [PATCH] use consistent queue(9) example for LIST removal; OK bluhm mvs --- sys/net/if_ethersubr.c | 7 +++---- 1 file 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); } -- 2.20.1