]> The Tcpdump Group git mirrors - tcpdump/commitdiff
If we don't have IPv6 address support, don't try to print IPv6 addresses.
authorGuy Harris <[email protected]>
Mon, 24 Dec 2012 11:13:23 +0000 (03:13 -0800)
committerGuy Harris <[email protected]>
Mon, 24 Dec 2012 11:13:23 +0000 (03:13 -0800)
print-babel.c

index 5fd7c21fbc746c36d0c0b117dbbd6b52a3fb13d5..c15f958670fd341e70ebf4d8aafe5f995f391807 100644 (file)
@@ -104,7 +104,11 @@ format_prefix(const u_char *prefix, unsigned char plen)
     if(plen >= 96 && memcmp(prefix, v4prefix, 12) == 0)
         snprintf(buf, 50, "%s/%u", ipaddr_string(prefix + 12), plen - 96);
     else
+#ifdef INET6
         snprintf(buf, 50, "%s/%u", ip6addr_string(prefix), plen);
+#else
+        snprintf(buf, 50, "IPv6 addresses not supported");
+#endif
     buf[49] = '\0';
     return buf;
 }
@@ -115,7 +119,11 @@ format_address(const u_char *prefix)
     if(memcmp(prefix, v4prefix, 12) == 0)
         return ipaddr_string(prefix + 12);
     else
+#ifdef INET6
         return ip6addr_string(prefix);
+#else
+        return "IPv6 addresses not supported";
+#endif
 }
 
 static int