aboutsummaryrefslogtreecommitdiff
path: root/contrib/tcpdump/print-enc.c
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2009-03-21 18:30:25 +0000
committerRui Paulo <rpaulo@FreeBSD.org>2009-03-21 18:30:25 +0000
commita5779b6e02d0404232959eede5a5d3a5c699adaf (patch)
tree9e93e51a04c09c3b9b900ef6611b8bbd1290f26f /contrib/tcpdump/print-enc.c
parent6b6e256ae1f5d69b5e217c61109e55a30c30f81f (diff)
parent0ea0e7ad03dff03bb5448f640640d7904c01c8d4 (diff)
downloadsrc-a5779b6e02d0404232959eede5a5d3a5c699adaf.tar.gz
src-a5779b6e02d0404232959eede5a5d3a5c699adaf.zip
Merge tcpdump 4.0.0 from the vendor branch.
Notes
Notes: svn path=/head/; revision=190207
Diffstat (limited to 'contrib/tcpdump/print-enc.c')
-rw-r--r--contrib/tcpdump/print-enc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/contrib/tcpdump/print-enc.c b/contrib/tcpdump/print-enc.c
index f9b871b351d8..9569534cbd70 100644
--- a/contrib/tcpdump/print-enc.c
+++ b/contrib/tcpdump/print-enc.c
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-enc.c,v 1.4 2005/04/06 21:32:39 mcr Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-enc.c,v 1.4.4.1 2008-02-06 10:34:15 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -70,8 +70,17 @@ enc_if_print(const struct pcap_pkthdr *h, register const u_char *p)
printf("SPI 0x%08x: ", (u_int32_t)ntohl(hdr->spi));
length -= ENC_HDRLEN;
- /* XXX - use the address family */
- ip_print(gndo, p + ENC_HDRLEN, length);
+ caplen -= ENC_HDRLEN;
+ p += ENC_HDRLEN;
+
+ switch (hdr->af) {
+ case AF_INET:
+ ip_print(gndo, p, length);
+ break;
+ case AF_INET6:
+ ip6_print(p, length);
+ break;
+ }
out:
return (ENC_HDRLEN);