diff options
author | Cedric Berger <cedric@cvs.openbsd.org> | 2003-09-08 17:35:58 +0000 |
---|---|---|
committer | Cedric Berger <cedric@cvs.openbsd.org> | 2003-09-08 17:35:58 +0000 |
commit | 2ebd27305f0ada96b0ffebada72ccd6d10ce4083 (patch) | |
tree | ba29d1e531443c49e360613b5b935eccbd3a2119 /usr.sbin/tcpdump | |
parent | fb453e988636889595275fa27915d15a5ebdab93 (diff) |
Fix 'tcpdump -v icmp' endianess buglet, print ID in hex.
Found by ho@, help/test pb@, hex suggestion/ok deraadt@
Diffstat (limited to 'usr.sbin/tcpdump')
-rw-r--r-- | usr.sbin/tcpdump/print-icmp.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/print-icmp.c b/usr.sbin/tcpdump/print-icmp.c index ba8becbd04f..c432765f116 100644 --- a/usr.sbin/tcpdump/print-icmp.c +++ b/usr.sbin/tcpdump/print-icmp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-icmp.c,v 1.14 2002/02/19 19:39:40 millert Exp $ */ +/* $OpenBSD: print-icmp.c,v 1.15 2003/09/08 17:35:57 cedric Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1993, 1994, 1995, 1996 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-icmp.c,v 1.14 2002/02/19 19:39:40 millert Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-icmp.c,v 1.15 2003/09/08 17:35:57 cedric Exp $ (LBL)"; #endif #include <sys/param.h> @@ -190,10 +190,11 @@ icmp_print(register const u_char *bp, register const u_char *bp2) if (vflag) { TCHECK(dp->icmp_seq); (void)snprintf(buf, sizeof buf, - "echo %s (id:%d seq:%d)", + "echo %s (id:%04x seq:%d)", (dp->icmp_type == ICMP_ECHO)? "request": "reply", - dp->icmp_id, dp->icmp_seq); + ntohs(dp->icmp_id), + ntohs(dp->icmp_seq)); } else str = tok2str(icmp2str, "type-#%d", dp->icmp_type); break; |