From 67a211e29898655e9e0795745d74b70b90493624 Mon Sep 17 00:00:00 2001 From: luis Date: Fri, 29 Mar 2013 18:02:36 +0000 Subject: [PATCH] Merge r30072 from nmap-npingchanges: Print ICMPv6 destination unreachable, time exceeded and parameter problem --- libnetutil/ICMPv6Header.cc | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/libnetutil/ICMPv6Header.cc b/libnetutil/ICMPv6Header.cc index 7c1d1a0bb..17cb963c2 100755 --- a/libnetutil/ICMPv6Header.cc +++ b/libnetutil/ICMPv6Header.cc @@ -200,11 +200,26 @@ int ICMPv6Header::print(FILE *output, int detail) const { fprintf(output, " (type=%u/code=%u)", type, code); switch(type) { - case ICMPv6_ECHO: - case ICMPv6_ECHOREPLY: - fprintf(output, " id=%u seq=%u", this->getIdentifier(), this->getSequence()); + + case ICMPv6_UNREACH: + case ICMPv6_TIMXCEED: + if(detail>=PRINT_DETAIL_HIGH) + fprintf(output, " unused=0x%08lX", (long unsigned int)this->getUnused()); break; + case ICMPv6_PKTTOOBIG: + fprintf(output, " mtu=%lu", (long unsigned int)this->getMTU()); + break; + + case ICMPv6_PARAMPROB: + fprintf(output, " pointer=%lu", (long unsigned int)this->getPointer()); + break; + + case ICMPv6_ECHO: + case ICMPv6_ECHOREPLY: + fprintf(output, " id=%u seq=%u", this->getIdentifier(), this->getSequence()); + break; + default: /* Print nothing */ break;