From: Alan T. DeKok Date: Wed, 18 Jan 2023 19:55:50 +0000 (-0500) Subject: include the header in the packet length X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fd24c4d90690afdca6e7e4c5e6fadea0af0a1f8;p=thirdparty%2Ffreeradius-server.git include the header in the packet length --- diff --git a/src/modules/rlm_tacacs/rlm_tacacs_tcp.c b/src/modules/rlm_tacacs/rlm_tacacs_tcp.c index aaf6358f52c..b56899106ab 100644 --- a/src/modules/rlm_tacacs/rlm_tacacs_tcp.c +++ b/src/modules/rlm_tacacs/rlm_tacacs_tcp.c @@ -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.