]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
move calls to listen_coa_free() so that we don't break things
authorAlan T. DeKok <aland@freeradius.org>
Thu, 1 Apr 2021 20:11:42 +0000 (16:11 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 2 Apr 2021 19:14:45 +0000 (15:14 -0400)
src/include/radiusd.h
src/main/listen.c
src/main/mainconfig.c
src/main/radiusd.c

index 92f400763e126395f78fc7c03564d92a2c312084..fde13869fd20441e123cdfa501b94439b2d5f0f5 100644 (file)
@@ -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);
index c60912db6d9be1172892d0c653e06e09f5d8218f..f470047d96a284e276d04d53d3c452db505d1976 100644 (file)
@@ -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
index 1e8627bea37eddab367777f575032f3abdc64033..db110ed6f54e9231e5dfd25d90a612d5af92c171 100644 (file)
@@ -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.
index 97395145096cfa878e07abab5a921bbe500b358d..06b566d073505e93f4dd81eec75cfad0bc03512c 100644 (file)
@@ -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