mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Don't destroy a non-closed socket, wait for all the callbacks.
We erroneously tried to destroy a socket after issuing isc__nm_tcp{,dns}_close. Under some (race) circumstances we could get nm_socket_cleanup to be called twice for the same socket, causing an access to a dead memory.
This commit is contained in:
committed by
Witold Kręcicki
parent
896db0f419
commit
233f134a4f
@@ -79,8 +79,10 @@ typedef struct isc__networker {
|
||||
* connections we have peer address here, so both TCP and UDP can be
|
||||
* handled with a simple send-like function
|
||||
*/
|
||||
#define NMHANDLE_MAGIC ISC_MAGIC('N', 'M', 'H', 'D')
|
||||
#define VALID_NMHANDLE(t) ISC_MAGIC_VALID(t, NMHANDLE_MAGIC)
|
||||
#define NMHANDLE_MAGIC ISC_MAGIC('N', 'M', 'H', 'D')
|
||||
#define VALID_NMHANDLE(t) \
|
||||
(ISC_MAGIC_VALID(t, NMHANDLE_MAGIC) && \
|
||||
atomic_load(&(t)->references) > 0)
|
||||
|
||||
typedef void (*isc__nm_closecb)(isc_nmhandle_t *);
|
||||
|
||||
|
Reference in New Issue
Block a user