From: Alan T. DeKok Date: Thu, 1 Apr 2021 20:11:42 +0000 (-0400) Subject: move calls to listen_coa_free() so that we don't break things X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c83d28318cbe22137862b916ad9cea74660f6388;p=thirdparty%2Ffreeradius-server.git move calls to listen_coa_free() so that we don't break things --- diff --git a/src/include/radiusd.h b/src/include/radiusd.h index 92f400763e..fde13869fd 100644 --- a/src/include/radiusd.h +++ b/src/include/radiusd.h @@ -562,7 +562,6 @@ void hup_logfile(void); /* listen.c */ void listen_free(rad_listen_t **head); -void listen_free_all(rad_listen_t **head); int listen_init(CONF_SECTION *cs, rad_listen_t **head, bool spawn_flag); rad_listen_t *proxy_new_listener(TALLOC_CTX *ctx, home_server_t *home, uint16_t src_port); RADCLIENT *client_listener_find(rad_listen_t *listener, fr_ipaddr_t const *ipaddr, uint16_t src_port); @@ -609,6 +608,7 @@ int proxy_tls_send(rad_listen_t *listener, REQUEST *request); #ifdef WITH_COA_TUNNEL int proxy_tls_send_reply(rad_listen_t *listener, REQUEST *request); int dual_tls_send_coa_request(rad_listen_t *listener, REQUEST *request); +void listen_coa_free(void); void listen_coa_add(rad_listen_t *listener, char const *key); void listen_coa_delete(rad_listen_t *listener); int listen_coa_find(REQUEST *request, char const *key); diff --git a/src/main/listen.c b/src/main/listen.c index c60912db6d..f470047d96 100644 --- a/src/main/listen.c +++ b/src/main/listen.c @@ -79,7 +79,6 @@ static int command_write_magic(int newfd, listen_socket_t *sock); #ifdef WITH_COA_TUNNEL static int listen_coa_init(void); -static void listen_coa_free(void); #endif static fr_protocol_t master_listen[]; @@ -3601,15 +3600,6 @@ void listen_free(rad_listen_t **head) *head = NULL; } -void listen_free_all(rad_listen_t **head) -{ - listen_free(head); - -#ifdef WITH_COA_TUNNEL - listen_coa_free(); -#endif -} - #ifdef WITH_STATS RADCLIENT_LIST *listener_find_client_list(fr_ipaddr_t const *ipaddr, uint16_t port, int proto) { @@ -3728,7 +3718,7 @@ static int listen_coa_init(void) return 0; } -static void listen_coa_free(void) +void listen_coa_free(void) { /* * If we are freeing the tree, then all of the listeners diff --git a/src/main/mainconfig.c b/src/main/mainconfig.c index 1e8627bea3..db110ed6f5 100644 --- a/src/main/mainconfig.c +++ b/src/main/mainconfig.c @@ -1205,7 +1205,7 @@ int main_config_free(void) */ client_list_free(NULL); realms_free(); - listen_free_all(&main_config.listen); + listen_free(&main_config.listen); /* * Frees current config and any previous configs. diff --git a/src/main/radiusd.c b/src/main/radiusd.c index 9739514509..06b566d073 100644 --- a/src/main/radiusd.c +++ b/src/main/radiusd.c @@ -694,6 +694,13 @@ cleanup: */ main_config_free(); +#ifdef WITH_COA_TUNNEL + /* + * This should be after freeing all of the listeners. + */ + listen_coa_free(); +#endif + #ifdef WIN32 WSACleanup(); #endif