From: Denis Ovsienko Date: Sat, 18 Aug 2018 11:12:18 +0000 (+0100) Subject: RADIUS: Deduplicate some printing code. X-Git-Tag: tcpdump-4.99-bp~1051 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/c5e03b4a0f5b7a24bfb5f2aab4bb9ba175168a90 RADIUS: Deduplicate some printing code. --- diff --git a/print-radius.c b/print-radius.c index 2df9a87d..13918a45 100644 --- a/print-radius.c +++ b/print-radius.c @@ -1174,26 +1174,22 @@ radius_attrs_print(netdissect_options *ndo, attr_string = attr_type[type].name; else attr_string = "Unknown"; - if (len < 2) - { - ND_PRINT("\n\t %s Attribute (%u), length: %u (bogus, must be >= 2)", + + ND_PRINT("\n\t %s Attribute (%u), length: %u", attr_string, type, len); - return; + if (len < 2) + { + ND_PRINT(" (bogus, must be >= 2)"); + return; } if (len > length) { - ND_PRINT("\n\t %s Attribute (%u), length: %u (bogus, goes past end of packet)", - attr_string, - type, - len); + ND_PRINT(" (bogus, goes past end of packet)"); return; } - ND_PRINT("\n\t %s Attribute (%u), length: %u, Value: ", - attr_string, - type, - len); + ND_PRINT(", Value: "); if (type < TAM_SIZE(attr_type)) {