diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-06-10 22:17:09 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-06-10 22:17:09 +0000 |
commit | 4f21df20f2a0d16374e88cdbbecf77ea14da871d (patch) | |
tree | 62e06ad97fd6ae284a1de885f9f5496e9e1752e3 /usr.sbin | |
parent | b65fe309c6e9ffe7b37594fbebca11590d752ae8 (diff) |
detailed ICMP_PARAMPROB printing; jakob@ ok
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/tcpdump/print-icmp.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/tcpdump/print-icmp.c b/usr.sbin/tcpdump/print-icmp.c index e3089ff696c..8e984ed5f44 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.8 2000/10/03 14:31:57 ho Exp $ */ +/* $OpenBSD: print-icmp.c,v 1.9 2001/06/10 22:17:08 mickey 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.8 2000/10/03 14:31:57 ho Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-icmp.c,v 1.9 2001/06/10 22:17:08 mickey Exp $ (LBL)"; #endif #include <sys/param.h> @@ -333,15 +333,19 @@ icmp_print(register const u_char *bp, register const u_char *bp2) break; case ICMP_PARAMPROB: - if (dp->icmp_code) - (void)snprintf(buf, sizeof buf, - "parameter problem - code %d", - dp->icmp_code); - else { + switch (dp->icmp_code) { + case ICMP_PARAMPROB_OPTABSENT: + str = "requested option absent"; + break; + case ICMP_PARAMPROB_LENGTH: + snprintf(buf, sizeof buf, "bad length %d", dp->icmp_pptr); + break; + default: TCHECK(dp->icmp_pptr); (void)snprintf(buf, sizeof buf, "parameter problem - octet %d", dp->icmp_pptr); + break; } break; |