mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-28 21:17:54 +00:00
When shutting down, the interface manager can be destroyed before the `route_connected()` callback is called, which is unexpected for the latter and can cause a crash. Move the interface manager attachment code from the callback to the place before the callback is registered using `isc_nm_routeconnect()` function, which will make sure that the interface manager will live at least until the callback is called. Make sure to detach the interface manager if the `isc_nm_routeconnect()` function is not implemented, or when the callback is called with a result value which differs from `ISC_R_SUCCESS`.