]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
TACACS+ client connections always start at 1, and increment by 2
authorAlan T. DeKok <aland@freeradius.org>
Tue, 17 Jan 2023 21:27:47 +0000 (16:27 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 17 Jan 2023 21:30:05 +0000 (16:30 -0500)
src/modules/rlm_tacacs/rlm_tacacs_tcp.c

index d760a839f0446f9f3aa50a863a29d6c5c872599f..3035d27e75cba57307b2131afe14705393e7ed59 100644 (file)
@@ -265,6 +265,8 @@ static fr_connection_state_t conn_init(void **h_out, fr_connection_t *conn, void
        h->max_packet_size = h->inst->max_packet_size;
        h->last_idle = fr_time();
 
+       h->id = 1;              /* clients send odd sequence numbers */
+
        /*
         *      Initialize the buffer of coalesced packets we're doing to write.
         */
@@ -840,7 +842,7 @@ static void request_mux(fr_event_list_t *el,
                h->tconn = tconn;
 
                h->tracking[u->id] = treq;
-               h->id++;
+               h->id += 2;
                h->active++;
 
                RDEBUG("Sending %s ID %d length %ld over connection %s",