summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2011-09-22 21:27:07 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2011-09-22 21:27:07 +0000
commiteead1e4a62b3951e1e4bd48159b73355a7836806 (patch)
tree1e44e5c846d429f271e75e753622aecad327b6c8 /usr.sbin
parent8ddc79dbb2698cc2b940e017da8dc52ec978be6e (diff)
Let tcpdump use the same format for printing IPv6 fragments as for
IPv4. Now it is id:len@off+more for both. ok jsing
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tcpdump/print-frag6.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/usr.sbin/tcpdump/print-frag6.c b/usr.sbin/tcpdump/print-frag6.c
index 816a31d7213..5df71e3f402 100644
--- a/usr.sbin/tcpdump/print-frag6.c
+++ b/usr.sbin/tcpdump/print-frag6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-frag6.c,v 1.4 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-frag6.c,v 1.5 2011/09/22 21:27:06 bluhm Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994
@@ -64,21 +64,14 @@ frag6_print(register const u_char *bp, register const u_char *bp2)
/* 'ep' points to the end of avaible data. */
ep = snapend;
- TCHECK(dp->ip6f_offlg);
+ TCHECK(dp->ip6f_ident);
- if (vflag) {
- TCHECK(dp->ip6f_ident);
- printf("frag (0x%08x:%d|%ld)",
- ntohl(dp->ip6f_ident),
- ntohs(dp->ip6f_offlg & IP6F_OFF_MASK),
- sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) -
- (long)(bp - bp2) - sizeof(struct ip6_frag));
- } else {
- printf("frag (%d|%ld)",
- ntohs(dp->ip6f_offlg & IP6F_OFF_MASK),
- sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) -
- (long)(bp - bp2) - sizeof(struct ip6_frag));
- }
+ printf("frag (0x%08x:%ld@%d%s)",
+ ntohl(dp->ip6f_ident),
+ sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen) -
+ (long)(bp - bp2) - sizeof(struct ip6_frag),
+ ntohs(dp->ip6f_offlg & IP6F_OFF_MASK),
+ (dp->ip6f_offlg & IP6F_MORE_FRAG) ? "+" : "");
/* it is meaningless to decode non-first fragment */
if (ntohs(dp->ip6f_offlg & IP6F_OFF_MASK) != 0)