X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/e3027f41d0120b4278cca462f397b6619dcd9ac5..0b4e3aa066abc0728aacb4bbeb86f53f9737156e:/bsd/netat/ddp_nbp.c diff --git a/bsd/netat/ddp_nbp.c b/bsd/netat/ddp_nbp.c index dd77e5fd5..e8dc74b46 100644 --- a/bsd/netat/ddp_nbp.c +++ b/bsd/netat/ddp_nbp.c @@ -116,10 +116,13 @@ void sethzonehash(elapp) void nbp_shutdown() { /* delete all NVE's and release buffers */ - register nve_entry_t *nve_entry, *next_nve; + register nve_entry_t *nve_entry, *nve_next; ATDISABLE(nve_lock_pri,NVE_LOCK); - TAILQ_FOREACH(nve_entry, &name_registry, nve_link) { + for ((nve_entry = TAILQ_FIRST(&name_registry)); nve_entry; nve_entry = nve_next) { + nve_next = TAILQ_NEXT(nve_entry, nve_link); + + /* NB: nbp_delete_entry calls TAILQ_REMOVE */ nbp_delete_entry(nve_entry); } ATENABLE(nve_lock_pri,NVE_LOCK);