]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
better error messages
authorAlan T. DeKok <aland@freeradius.org>
Sun, 17 Jan 2021 13:38:29 +0000 (08:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 17 Jan 2021 13:39:16 +0000 (08:39 -0500)
src/protocols/tacacs/decode.c
src/protocols/tacacs/encode.c

index c5d80eb46568497dc05e68137f9e8329632a43d8..3f9726e0c46ac5b514b675dfe9aa3889da1e1092 100644 (file)
@@ -443,7 +443,7 @@ ssize_t fr_tacacs_decode(TALLOC_CTX *ctx, uint8_t const *buffer, size_t buffer_l
 
                } else {
                unknown_packet:
-                       fr_strerror_const("Unknown packet type");
+                       fr_strerror_const("Unknown authentication packet");
                        goto fail;
                }
                break;
index 60929581206f9e20205d55290b7846f40e1eac2f..680691efa36830c9043afd2e7268dc2dfc0264f3 100644 (file)
@@ -350,8 +350,8 @@ ssize_t fr_tacacs_encode(fr_dbuff_t *dbuff, uint8_t const *original_packet, char
 
                        goto check_reply;
                }
-       unknown_packet:
-               fr_strerror_const("decode: Unknown packet type");
+
+               fr_strerror_const("encode: Unknown authentication packet type");
                return -1;
 
        case FR_TAC_PLUS_AUTHOR:
@@ -488,7 +488,9 @@ ssize_t fr_tacacs_encode(fr_dbuff_t *dbuff, uint8_t const *original_packet, char
                        goto check_reply;
 
                }
-               goto unknown_packet;
+
+               fr_strerror_const("encode: Unknown authorization packet type");
+               return -1;
 
        case FR_TAC_PLUS_ACCT:
                if (packet_is_acct_request(packet)) {
@@ -631,10 +633,12 @@ ssize_t fr_tacacs_encode(fr_dbuff_t *dbuff, uint8_t const *original_packet, char
                        packet->hdr.seq_no &= 0xfe;
                        break;
                }
-               goto unknown_packet;
+
+               fr_strerror_const("encode: Unknown accounting packet type");
+               return -1;
 
        default:
-               fr_strerror_printf("encode: TACACS+ type %u", packet->hdr.type);
+               fr_strerror_printf("encode: unknown packet type %u", packet->hdr.type);
                return -1;
        }