]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-babel.c
CVE-2017-13687/CHDLC: Improve bounds and length checks.
[tcpdump] / print-babel.c
index 1d20988c5eaf20369ada553e5483bccfdd04da70..f8741d7bfd19fc314bb34b82a7f28c3bb52937bb 100644 (file)
@@ -26,6 +26,8 @@
  * SUCH DAMAGE.
  */
 
+/* \summary: Babel Routing Protocol printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -40,7 +42,6 @@
 #include "extract.h"
 
 static const char tstr[] = "[|babel]";
-static const char istr[] = " (invalid)";
 
 static void babel_print_v2(netdissect_options *, const u_char *cp, u_int length);
 
@@ -126,11 +127,7 @@ format_prefix(netdissect_options *ndo, const u_char *prefix, unsigned char plen)
     if(plen >= 96 && memcmp(prefix, v4prefix, 12) == 0)
         snprintf(buf, 50, "%s/%u", ipaddr_string(ndo, prefix + 12), plen - 96);
     else
-#ifdef INET6
         snprintf(buf, 50, "%s/%u", ip6addr_string(ndo, prefix), plen);
-#else
-        snprintf(buf, 50, "IPv6 addresses not supported");
-#endif
     buf[49] = '\0';
     return buf;
 }
@@ -141,11 +138,7 @@ format_address(netdissect_options *ndo, const u_char *prefix)
     if(memcmp(prefix, v4prefix, 12) == 0)
         return ipaddr_string(ndo, prefix + 12);
     else
-#ifdef INET6
         return ip6addr_string(ndo, prefix);
-#else
-        return "IPv6 addresses not supported";
-#endif
 }
 
 static const char *