return;
}
+ if (eresult == ISC_R_SHUTTINGDOWN) {
+ /*
+ * The mgr->route and mgr is detached in
+ * ns_interfacemgr_shutdown()
+ */
+ return;
+ }
+
if (eresult != ISC_R_SUCCESS) {
if (eresult != ISC_R_CANCELED) {
isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_ERROR,
isc_result_totext(eresult));
}
isc_nmhandle_detach(&mgr->route);
+ ns_interfacemgr_detach(&mgr);
return;
}
"recompile required",
rtm->rtm_version, RTM_VERSION);
isc_nmhandle_detach(&mgr->route);
+ ns_interfacemgr_detach(&mgr);
return;
}
#endif /* ifdef RTM_VERSION */
if (done) {
isc_nmhandle_detach(&mgr->route);
+ ns_interfacemgr_detach(&mgr);
}
return;
}
INSIST(mgr->route == NULL);
+ ns_interfacemgr_attach(mgr, &(ns_interfacemgr_t *){ NULL });
isc_nmhandle_attach(handle, &mgr->route);
isc_nm_read(handle, route_recv, mgr);
}
isc_refcount_destroy(&mgr->references);
- if (mgr->route != NULL) {
- isc_nmhandle_detach(&mgr->route);
- }
dns_aclenv_detach(&mgr->aclenv);
ns_listenlist_detach(&mgr->listenon4);
ns_listenlist_detach(&mgr->listenon6);
/*%
* Shut down and detach all interfaces.
- * By incrementing the generation count, we make purge_old_interfaces()
- * consider all interfaces "old".
+ * By incrementing the generation count, we make
+ * purge_old_interfaces() consider all interfaces "old".
*/
mgr->generation++;
atomic_store(&mgr->shuttingdown, true);
- LOCK(&mgr->lock);
+ purge_old_interfaces(mgr);
+
if (mgr->route != NULL) {
isc_nmhandle_detach(&mgr->route);
+ ns_interfacemgr_detach(&mgr);
}
- UNLOCK(&mgr->lock);
-
- purge_old_interfaces(mgr);
}
static isc_result_t