]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-babel.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-babel.c
index 6bcc3337e84b969826b5dffcc1e512c7a2ad9d06..c7593ce1f2d16ac2582950d5fec58aeee8d9f3e7 100644 (file)
@@ -37,9 +37,7 @@
  * draft-ietf-babel-source-specific-0
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -50,7 +48,6 @@
 #include "addrtoname.h"
 #include "extract.h"
 
-
 static void babel_print_v2(netdissect_options *, const u_char *cp, u_int length);
 
 void
@@ -58,7 +55,7 @@ babel_print(netdissect_options *ndo,
             const u_char *cp, u_int length)
 {
     ndo->ndo_protocol = "babel";
-    ND_PRINT("babel");
+    nd_print_protocol(ndo);
 
     ND_TCHECK_4(cp);
 
@@ -82,7 +79,6 @@ babel_print(netdissect_options *ndo,
 
  trunc:
     nd_print_trunc(ndo);
-    return;
 }
 
 /* TLVs */
@@ -386,7 +382,7 @@ babel_print_v2_tlvs(netdissect_options *ndo,
     u_char v4_prefix[16] =
         {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0 };
     u_char v6_prefix[16] = {0};
+
     i = 0;
     while(i < tlvs_length) {
         const u_char *message;
@@ -396,7 +392,6 @@ babel_print_v2_tlvs(netdissect_options *ndo,
         message = cp + i;
 
         ICHECK(i, 1);
-        ND_TCHECK_1(message);
         if((type = GET_U_1(message)) == MESSAGE_PAD1) {
             ND_PRINT(ndo->ndo_vflag ? "\n\tPad 1" : " pad1");
             i += 1;
@@ -759,7 +754,7 @@ babel_print_v2_tlvs(netdissect_options *ndo,
         case MESSAGE_MAC: {
             if (!ndo->ndo_vflag)
                 ND_PRINT(" mac");
-            else { 
+            else {
                 ND_PRINT("\n\tMAC ");
                 ND_PRINT("len %u", len);
             }
@@ -847,9 +842,9 @@ babel_print_v2(netdissect_options *ndo,
 
     /* If there's a trailer, process the TLVs in the trailer */
     if (length != 0) {
-       if(ndo->ndo_vflag) ND_PRINT("\n\t----");
-       else ND_PRINT(" |");
-        babel_print_v2_tlvs(ndo, cp, length, length);
+       if(ndo->ndo_vflag) ND_PRINT("\n\t----");
+       else ND_PRINT(" |");
+        ret = babel_print_v2_tlvs(ndo, cp, length, length);
         if (ret == -1)
             goto trunc;
         if (ret == -2)
@@ -863,5 +858,4 @@ babel_print_v2(netdissect_options *ndo,
 
  invalid:
     nd_print_invalid(ndo);
-    return;
 }