summaryrefslogtreecommitdiff
blob: ba47b5daec1f6fd826dd8b8ee2930dda347276e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Fix compiling with USE=-ipv6 (bug #395031).
https://bugs.gentoo.org/395031

--- a/tcpdump-4.2.0/print-babel.c
+++ b/tcpdump-4.2.0/print-babel.c
@@ -115,10 +115,14 @@
 format_prefix(const u_char *prefix, unsigned char plen)
 {
     static char buf[50];
+#ifdef INET6
     if(plen >= 96 && memcmp(prefix, v4prefix, 12) == 0)
+#endif
         snprintf(buf, 50, "%s/%u", ipaddr_string(prefix + 12), plen - 96);
+#ifdef INET6
     else
         snprintf(buf, 50, "%s/%u", ip6addr_string(prefix), plen);
+#endif
     buf[49] = '\0';
     return buf;
 }
@@ -126,10 +130,14 @@
 static const char *
 format_address(const u_char *prefix)
 {
+#ifdef INET6
     if(memcmp(prefix, v4prefix, 12) == 0)
+#endif
         return ipaddr_string(prefix + 12);
+#ifdef INET6
     else
         return ip6addr_string(prefix);
+#endif
 }
 
 static int