]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-radius.c
RADIUS: Deduplicate some printing code.
[tcpdump] / print-radius.c
index 2df9a87d411b8730e89387ab77ecd556f6c3d8a7..13918a45630c11ce3e1b33667025c17f9b7c71fc 100644 (file)
@@ -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))
      {