]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
minor cleanups and some notes
authorAlan T. DeKok <aland@freeradius.org>
Sat, 15 Aug 2020 22:15:26 +0000 (18:15 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 15 Aug 2020 22:15:26 +0000 (18:15 -0400)
src/protocols/tacacs/encode.c

index 2d5311b38e2f1ae4506305f8b9ce5a01e2875f46..fa2d9c7acba0722cbaee0c1a6a81e37ef1c6802a 100644 (file)
@@ -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
         */