diff --git a/lib/ns/interfacemgr.c b/lib/ns/interfacemgr.c index 473a79f0c1..118b7c0367 100644 --- a/lib/ns/interfacemgr.c +++ b/lib/ns/interfacemgr.c @@ -262,12 +262,12 @@ route_connected(isc_nmhandle_t *handle, isc_result_t eresult, void *arg) { "route_connected: %s", isc_result_totext(eresult)); if (eresult != ISC_R_SUCCESS) { + 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); } @@ -345,7 +345,14 @@ ns_interfacemgr_create(isc_mem_t *mctx, ns_server_t *sctx, } if (scan) { - result = isc_nm_routeconnect(nm, route_connected, mgr); + ns_interfacemgr_t *imgr = NULL; + + ns_interfacemgr_attach(mgr, &imgr); + + result = isc_nm_routeconnect(nm, route_connected, imgr); + if (result == ISC_R_NOTIMPLEMENTED) { + ns_interfacemgr_detach(&imgr); + } if (result != ISC_R_SUCCESS) { isc_log_write(IFMGR_COMMON_LOGARGS, ISC_LOG_INFO, "unable to open route socket: %s",