]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Rename CONN_UNUSED to CONN_INIT
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 1 Oct 2017 13:26:13 +0000 (21:26 +0800)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sun, 1 Oct 2017 13:28:25 +0000 (21:28 +0800)
src/modules/rlm_radius/rlm_radius_udp.c

index 34470636ca04c8aff80a5d313ee493f999093d40..8a2199b5575d825b5fe4e53520f5a7bf48e5c356 100644 (file)
@@ -80,7 +80,7 @@ typedef struct rlm_radius_udp_thread_t {
 } rlm_radius_udp_thread_t;
 
 typedef enum rlm_radius_udp_connection_state_t {
-       CONN_UNUSED = 0,
+       CONN_INIT = 0,                                  //!< Configured but not started.
        CONN_OPENING,                                   //!< Trying to connect.
        CONN_ACTIVE,                                    //!< Available to send packets.
        CONN_FULL,                                      //!< Live, but can't send more packets.
@@ -243,7 +243,7 @@ static void conn_idle(rlm_radius_udp_connection_t *c)
         *      state.
         */
        switch (c->state) {
-       case CONN_UNUSED:
+       case CONN_INIT:
        case CONN_OPENING:
                rad_assert(0 == 1);
                return;
@@ -1504,7 +1504,7 @@ static int udp_request_free(rlm_radius_udp_request_t *u)
                /*
                 *      If it's unused, why is there a request for it?
                 */
-       case CONN_UNUSED:
+       case CONN_INIT:
        case CONN_OPENING:
                rad_assert(0 == 1);
                return 0;
@@ -1707,6 +1707,8 @@ static fr_connection_state_t _conn_init(int *fd_out, void *uctx)
        int                             fd;
        rlm_radius_udp_connection_t     *c = talloc_get_type_abort(uctx, rlm_radius_udp_connection_t);
 
+       rad_assert(c->state == CONN_INIT);
+
        /*
         *      Open the outgoing socket.
         */
@@ -1820,6 +1822,9 @@ static int _conn_free(rlm_radius_udp_connection_t *c)
                rad_assert(0 == 1);
                break;
 
+       case CONN_INIT:
+               break;
+
        case CONN_STATUS_CHECKS:
        case CONN_OPENING:
        case CONN_FULL: