From: Alan T. DeKok Date: Tue, 7 Feb 2023 22:16:29 +0000 (-0500) Subject: don't bother setting "single connection" in listener X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca4db08d19b1193a1f133c944f161b58013e901c;p=thirdparty%2Ffreeradius-server.git don't bother setting "single connection" in listener it's already set by the encoder --- diff --git a/src/listen/tacacs/proto_tacacs_tcp.c b/src/listen/tacacs/proto_tacacs_tcp.c index 0e979e20d8a..74ea9ffdbd2 100644 --- a/src/listen/tacacs/proto_tacacs_tcp.c +++ b/src/listen/tacacs/proto_tacacs_tcp.c @@ -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.. */ - 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; - } } /* diff --git a/src/protocols/tacacs/encode.c b/src/protocols/tacacs/encode.c index 9925d692251..a83a0e6bfed 100644 --- a/src/protocols/tacacs/encode.c +++ b/src/protocols/tacacs/encode.c @@ -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; }