]> 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>
Thu, 22 Jul 2021 13:55:22 +0000 (09:55 -0400)
src/include/radiusd.h
src/main/listen.c
src/main/mainconfig.c
src/main/radiusd.c

index 62956d4191e85da9c516236621e383cb3787d1ba..0e485f8b661d69336a28099f171a05a824db64e7 100644 (file)
@@ -564,7 +564,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);
@@ -611,6 +610,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 a31430fafffcaf7445abdbb2d85af3fbd1795f03..f2a23169f6a61e304fce8adee770cd62a6caa0eb 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[];
@@ -3638,15 +3637,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)
 {
@@ -3765,7 +3755,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 71f202f538b7e8c24b9635c1226b18381f03ddb1..b134712356b27ca62fc6f1c8341f3646d51fe70e 100644 (file)
@@ -1206,7 +1206,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