]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/ddp_nbp.c
xnu-201.tar.gz
[apple/xnu.git] / bsd / netat / ddp_nbp.c
index dd77e5fd5c690bb6fe3536696d212227e2a77e70..e8dc74b466f218585bf3108ef4861546aa1dede1 100644 (file)
@@ -116,10 +116,13 @@ void sethzonehash(elapp)
 void nbp_shutdown()
 {
        /* delete all NVE's and release buffers */
 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);
 
        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);
                nbp_delete_entry(nve_entry);
        }
        ATENABLE(nve_lock_pri,NVE_LOCK);