From: Alan T. DeKok Date: Sat, 15 Aug 2020 22:15:26 +0000 (-0400) Subject: minor cleanups and some notes X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bc575eae85f265d14ff58a89adb6bc88e578546;p=thirdparty%2Ffreeradius-server.git minor cleanups and some notes --- diff --git a/src/protocols/tacacs/encode.c b/src/protocols/tacacs/encode.c index 2d5311b38e2..fa2d9c7acba 100644 --- a/src/protocols/tacacs/encode.c +++ b/src/protocols/tacacs/encode.c @@ -162,10 +162,6 @@ ssize_t fr_tacacs_encode(uint8_t *buffer, size_t buffer_len, char const *secret, if (vp->da->parent == attr_tacacs_packet) break; } - /* - * For simplicity, we allow the caller to omit things - * that they don't care about. - */ if (!vp) { fr_strerror_printf("No TACACS+ %s in the attribute list", attr_tacacs_packet->name); @@ -179,13 +175,19 @@ ssize_t fr_tacacs_encode(uint8_t *buffer, size_t buffer_len, char const *secret, * Call the struct encoder to do the actual work. */ len = fr_struct_to_network(buffer, buffer_len, &da_stack, 0, &cursor, NULL, NULL); - if (len != sizeof(fr_tacacs_packet_hdr_t)) { fr_strerror_printf("Failed encoding %s using fr_struct_to_network()", attr_tacacs_packet->name); return -1; } + /* + * @todo - have this function take a `uint8_t const + * *original` argument. We can then automatically fill + * in fields such as sequence number and session ID based + * on the original packet. + */ + /* * Handle directly in the allocated buffer */