]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't bother setting "single connection" in listener
authorAlan T. DeKok <aland@freeradius.org>
Tue, 7 Feb 2023 22:16:29 +0000 (17:16 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 7 Feb 2023 23:19:19 +0000 (18:19 -0500)
it's already set by the encoder

src/listen/tacacs/proto_tacacs_tcp.c
src/protocols/tacacs/encode.c

index 0e979e20d8a1ded3fcf4220e5fbfa032db6dc2e8..74ea9ffdbd2eefbd674be7bc462ae6d76d2989ae 100644 (file)
@@ -40,9 +40,6 @@ typedef struct {
        char const                      *name;                  //!< socket name
        int                             sockfd;
 
-       bool                            seen_first_packet;
-       bool                            single_connection;
-
        fr_io_address_t                 *connection;            //!< for connected sockets.
 
        fr_stats_t                      stats;                  //!< statistics for this socket
@@ -161,17 +158,6 @@ static ssize_t mod_read(fr_listen_t *li, UNUSED void **packet_ctx, fr_time_t *re
        *recv_time_p = fr_time();
        thread->stats.total_requests++;
 
-       /*
-        *      See if we negotiated multiple sessions on a single
-        *      connection.
-        */
-       if (!thread->seen_first_packet) {
-               fr_tacacs_packet_t *pkt = (fr_tacacs_packet_t *) buffer;
-
-               thread->seen_first_packet = true;
-               thread->single_connection = ((pkt->hdr.flags & FR_FLAGS_VALUE_SINGLE_CONNECT) != 0);
-       }
-
        /*
         *      proto_tacacs sets the priority
         */
@@ -193,7 +179,6 @@ static ssize_t mod_write(fr_listen_t *li, UNUSED void *packet_ctx, UNUSED fr_tim
 {
        proto_tacacs_tcp_thread_t       *thread = talloc_get_type_abort(li->thread_instance, proto_tacacs_tcp_thread_t);
        ssize_t                         data_size;
-       fr_tacacs_packet_t              *pkt;
 
        /*
         *      We only write TACACS packets.
@@ -209,17 +194,8 @@ static ssize_t mod_write(fr_listen_t *li, UNUSED void *packet_ctx, UNUSED fr_tim
         *      put the stats in the listener, so that proto_tacacs
         *      can update them, too.. <sigh>
         */
-       pkt = (fr_tacacs_packet_t *) buffer;
        if (written == 0) {
                thread->stats.total_responses++;
-
-               /*
-                *      If this is the first reply, then ACK the single connection flag.
-                */
-               if (thread->single_connection) {
-                       thread->single_connection = false;
-                       pkt->hdr.flags |= FR_FLAGS_VALUE_SINGLE_CONNECT;
-               }
        }
 
        /*
index 9925d6922510f5d7fa9c35a6515445035fb51985..a83a0e6bfed6f717ee6ccb0c6605c4d298541acf 100644 (file)
@@ -335,13 +335,13 @@ ssize_t fr_tacacs_encode(fr_dbuff_t *dbuff, uint8_t const *original_packet, char
         */
        if (original) {
                /*
-                *      Make room and fill up the original header. Ah! we shouldn't just copy the original packet,
+                *      Make room and fill up the original header. We shouldn't just copy the original packet,
                 *      because the fields 'seq_no' and 'length' are not the same.
                 */
                FR_DBUFF_ADVANCE_RETURN(&work_dbuff, sizeof(fr_tacacs_packet_hdr_t));
                packet->hdr.version = original->version;
                packet->hdr.type = original->type;
-               packet->hdr.flags = original->flags;
+               packet->hdr.flags = original->flags; /* encrypted && single connection */
                packet->hdr.session_id = original->session_id;
        }