]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
include the header in the packet length
authorAlan T. DeKok <aland@freeradius.org>
Wed, 18 Jan 2023 19:55:50 +0000 (14:55 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 18 Jan 2023 19:55:50 +0000 (14:55 -0500)
src/modules/rlm_tacacs/rlm_tacacs_tcp.c

index aaf6358f52c20f6a8dc4db4377fe80a6008c8ede..b56899106ab6063f8fabc3cb991e58913337b777 100644 (file)
@@ -1089,9 +1089,11 @@ static void request_demux(UNUSED fr_event_list_t *el, fr_trunk_connection_t *tco
                }
 
                /*
-                *      The packet contains a 4 octet length in the header.
+                *      The packet contains a 4 octet length in the
+                *      header, but the header bytes aren't included
+                *      in the 4 octet length field.
                 */
-               packet_len = fr_nbo_to_uint32(h->recv.read + 8);
+               packet_len = fr_nbo_to_uint32(h->recv.read + 8) + FR_HEADER_LENGTH;
 
                /*
                 *      The packet is too large, reject it.