+ if (pr->ndpr_stateflags & NDPRF_DEFUNCT)
+ return;
+
+ /*
+ * If there are no more addresses, defunct the prefix. This is needed
+ * because we don't want multiple threads calling prelist_remove() for
+ * the same prefix and this might happen because we unlock nd6_mutex
+ * down below.
+ */
+ if (pr->ndpr_addrcnt == 0)
+ pr->ndpr_stateflags |= NDPRF_DEFUNCT;
+