mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
[master] detach route socket when shutting down
3800. [bug] A pending event on the route socket could cause an assertion failure when shutting down named. [RT #35674]
This commit is contained in:
parent
44fbdddcad
commit
7ef5dc87b6
3
CHANGES
3
CHANGES
@ -1,3 +1,6 @@
|
|||||||
|
3800. [bug] A pending event on the route socket could cause an
|
||||||
|
assertion failure when shutting down named. [RT #35674]
|
||||||
|
|
||||||
3799. [bug] Improve named's command line error reporting.
|
3799. [bug] Improve named's command line error reporting.
|
||||||
[RT #35603]
|
[RT #35603]
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@ route_event(isc_task_t *task, isc_event_t *event) {
|
|||||||
isc_region_t r;
|
isc_region_t r;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
struct MSGHDR *rtm;
|
struct MSGHDR *rtm;
|
||||||
|
isc_boolean_t done = ISC_TRUE;
|
||||||
|
|
||||||
UNUSED(task);
|
UNUSED(task);
|
||||||
|
|
||||||
@ -130,8 +131,6 @@ route_event(isc_task_t *task, isc_event_t *event) {
|
|||||||
"rtm->rtm_version mismatch (%u != %u) "
|
"rtm->rtm_version mismatch (%u != %u) "
|
||||||
"recompile required", rtm->rtm_version,
|
"recompile required", rtm->rtm_version,
|
||||||
RTM_VERSION);
|
RTM_VERSION);
|
||||||
isc_task_detach(&mgr->task);
|
|
||||||
isc_socket_detach(&mgr->route);
|
|
||||||
ns_interfacemgr_detach(&mgr);
|
ns_interfacemgr_detach(&mgr);
|
||||||
isc_event_free(&event);
|
isc_event_free(&event);
|
||||||
return;
|
return;
|
||||||
@ -148,16 +147,24 @@ route_event(isc_task_t *task, isc_event_t *event) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
LOCK(&mgr->lock);
|
||||||
* Look for next route event.
|
if (mgr->route != NULL) {
|
||||||
*/
|
/*
|
||||||
r.base = mgr->buf;
|
* Look for next route event.
|
||||||
r.length = sizeof(mgr->buf);
|
*/
|
||||||
result = isc_socket_recv(mgr->route, &r, 1, mgr->task,
|
r.base = mgr->buf;
|
||||||
route_event, mgr);
|
r.length = sizeof(mgr->buf);
|
||||||
if (result != ISC_R_SUCCESS)
|
result = isc_socket_recv(mgr->route, &r, 1, mgr->task,
|
||||||
|
route_event, mgr);
|
||||||
|
if (result == ISC_R_SUCCESS)
|
||||||
|
done = ISC_FALSE;
|
||||||
|
}
|
||||||
|
UNLOCK(&mgr->lock);
|
||||||
|
|
||||||
|
if (done)
|
||||||
ns_interfacemgr_detach(&mgr);
|
ns_interfacemgr_detach(&mgr);
|
||||||
isc_event_free(&event);
|
isc_event_free(&event);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -243,8 +250,11 @@ ns_interfacemgr_create(isc_mem_t *mctx, isc_taskmgr_t *taskmgr,
|
|||||||
|
|
||||||
result = isc_socket_recv(mgr->route, &r, 1, mgr->task,
|
result = isc_socket_recv(mgr->route, &r, 1, mgr->task,
|
||||||
route_event, mgr);
|
route_event, mgr);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS) {
|
||||||
|
isc_task_detach(&mgr->task);
|
||||||
|
isc_socket_detach(&mgr->route);
|
||||||
ns_interfacemgr_detach(&mgr);
|
ns_interfacemgr_detach(&mgr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
@ -326,8 +336,13 @@ ns_interfacemgr_shutdown(ns_interfacemgr_t *mgr) {
|
|||||||
*/
|
*/
|
||||||
mgr->generation++;
|
mgr->generation++;
|
||||||
#ifdef USE_ROUTE_SOCKET
|
#ifdef USE_ROUTE_SOCKET
|
||||||
if (mgr->route != NULL)
|
LOCK(&mgr->lock);
|
||||||
|
if (mgr->route != NULL) {
|
||||||
isc_socket_cancel(mgr->route, mgr->task, ISC_SOCKCANCEL_RECV);
|
isc_socket_cancel(mgr->route, mgr->task, ISC_SOCKCANCEL_RECV);
|
||||||
|
isc_socket_detach(&mgr->route);
|
||||||
|
isc_task_detach(&mgr->task);
|
||||||
|
}
|
||||||
|
UNLOCK(&mgr->lock);
|
||||||
#endif
|
#endif
|
||||||
purge_old_interfaces(mgr);
|
purge_old_interfaces(mgr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user