diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-10-01 15:32:11 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-10-01 15:32:11 -0700 |
commit | a6f81d534ddc1026442664d21a2122d64ab571a9 (patch) | |
tree | 0c856b94619099775613d6a07a6f56e17014f392 /print-pflog.c | |
parent | 214eb814eeced4f3ffa3c84455f0b168c756e57e (diff) | |
download | tcpdump-a6f81d534ddc1026442664d21a2122d64ab571a9.tar.gz |
Leave it up to ip6_print() to handle non-IPv6-capable systems.
Always define and declare ip6_print(), always compile print-ip6.c, and
always call it if we recognize a payload as IPv6. If INET6 isn't
defined, ip6_print() will just print the length and note that printing
isn't supported.
That way, we don't do weird dissection of IPv6 packets on systems
without IPv6 support, due to, for example, ethertype_print() returning 0
("not dissected") for IPv6 packets on those systems (IPv6-over-Frame
Relay was dissected weirdly due to this).
Diffstat (limited to 'print-pflog.c')
-rw-r--r-- | print-pflog.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/print-pflog.c b/print-pflog.c index 4263a469..72ae2763 100644 --- a/print-pflog.c +++ b/print-pflog.c @@ -152,14 +152,16 @@ pflog_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, ip_print(ndo, p, length); break; -#ifdef INET6 +#if defined(AF_INET6) || defined(OPENBSD_AF_INET6) +#ifdef AF_INET6 case AF_INET6: -#if OPENBSD_AF_INET6 != AF_INET6 +#endif /* AF_INET6 */ +#if !defined(AF_INET6) || OPENBSD_AF_INET6 != AF_INET6 case OPENBSD_AF_INET6: /* XXX: read pcap files */ -#endif +#endif /* !defined(AF_INET6) || OPENBSD_AF_INET6 != AF_INET6 */ ip6_print(ndo, p, length); break; -#endif +#endif /* defined(AF_INET6) || defined(OPENBSD_AF_INET6) */ default: /* address family not handled, print raw packet */ |