X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/c9d84d15c5c4dc8eca7594101fe5026080ed641e..bc67cfbfb0c68bad6e2b69d4a0d25310e6e52be7:/print-null.c diff --git a/print-null.c b/print-null.c index f5b03227..7089eb9d 100644 --- a/print-null.c +++ b/print-null.c @@ -21,7 +21,11 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.26 1999-10-30 05:11:18 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.30 1999-12-22 06:27:21 itojun Exp $ (LBL)"; +#endif + +#ifdef HAVE_CONFIG_H +#include "config.h" #endif #include @@ -123,14 +127,19 @@ null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) if (eflag) null_print(p, ip, length); -#ifndef INET6 - ip_print((const u_char *)ip, length); -#else - if (ip->ip_v == IPVERSION) + switch (ip->ip_v) { + case 4: ip_print((const u_char *)ip, length); - else if (ip->ip_v == 6) + break; +#ifdef INET6 + case 6: ip6_print((const u_char *)ip, length); -#endif /*INET6*/ + break; +#endif /* INET6 */ + default: + printf("ip v%d", ip->ip_v); + break; + } if (xflag) default_print((const u_char *)ip, caplen - NULL_HDRLEN);