summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2011-09-17 19:56:19 +0000
committerbluhm <bluhm@openbsd.org>2011-09-17 19:56:19 +0000
commit8f827db390f771437d12e30d84da0e3463e305df (patch)
tree4396f75c3fb7d9488cfb56cd1261c6c272a68eb5
parentadd (failing) test for a corner case discovered by aja@: linebreaks inside fields (diff)
downloadwireguard-openbsd-8f827db390f771437d12e30d84da0e3463e305df.tar.xz
wireguard-openbsd-8f827db390f771437d12e30d84da0e3463e305df.zip
Make tcpdump -v print the id and seq of icmp6 echo packets.
ok claudio naddy
-rw-r--r--usr.sbin/tcpdump/print-icmp6.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/print-icmp6.c b/usr.sbin/tcpdump/print-icmp6.c
index b8609b041e1..582d4242479 100644
--- a/usr.sbin/tcpdump/print-icmp6.c
+++ b/usr.sbin/tcpdump/print-icmp6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-icmp6.c,v 1.9 2011/09/17 15:59:44 naddy Exp $ */
+/* $OpenBSD: print-icmp6.c,v 1.10 2011/09/17 19:56:19 bluhm Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994
@@ -226,10 +226,14 @@ icmp6_print(const u_char *bp, u_int length, const u_char *bp2)
}
break;
case ICMP6_ECHO_REQUEST:
- printf("icmp6: echo request");
- break;
case ICMP6_ECHO_REPLY:
- printf("icmp6: echo reply");
+ printf("icmp6: echo %s", dp->icmp6_type == ICMP6_ECHO_REQUEST ?
+ "request" : "reply");
+ if (vflag) {
+ TCHECK(dp->icmp6_seq);
+ printf(" (id:%04x seq:%u)",
+ ntohs(dp->icmp6_id), ntohs(dp->icmp6_seq));
+ }
break;
case ICMP6_MEMBERSHIP_QUERY:
printf("icmp6: multicast listener query ");