PR/45747: Henning Petersen: Fix icmp6 verbose printing.

This commit is contained in:
christos 2011-12-27 15:12:45 +00:00
parent 0c0ccce6e1
commit a848253371
1 changed files with 15 additions and 10 deletions

View File

@ -25,7 +25,7 @@
static const char rcsid[] _U_ = static const char rcsid[] _U_ =
"@(#) Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.86 2008-02-05 19:36:13 guy Exp"; "@(#) Header: /tcpdump/master/tcpdump/print-icmp6.c,v 1.86 2008-02-05 19:36:13 guy Exp";
#else #else
__RCSID("$NetBSD: print-icmp6.c,v 1.2 2010/12/05 05:11:30 christos Exp $"); __RCSID("$NetBSD: print-icmp6.c,v 1.3 2011/12/27 15:12:45 christos Exp $");
#endif #endif
#endif #endif
@ -355,15 +355,20 @@ icmp6_print(netdissect_options *ndo,
printf("ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",dp->icmp6_type)); printf("ICMP6, %s", tok2str(icmp6_type_values,"unknown icmp6 type (%u)",dp->icmp6_type));
/* display cosmetics: print the packet length for printer that use the vflag now */ /* display cosmetics: print the packet length for printer that use the vflag now */
if (vflag && (dp->icmp6_type == if (vflag)
ND_ROUTER_SOLICIT || switch (dp->icmp6_type) {
ND_ROUTER_ADVERT || case ND_ROUTER_SOLICIT:
ND_NEIGHBOR_ADVERT || case ND_ROUTER_ADVERT:
ND_NEIGHBOR_SOLICIT || case ND_NEIGHBOR_ADVERT:
ND_REDIRECT || case ND_NEIGHBOR_SOLICIT:
ICMP6_HADISCOV_REPLY || case ND_REDIRECT:
ICMP6_MOBILEPREFIX_ADVERT )) case ICMP6_HADISCOV_REPLY:
printf(", length %u", length); case ICMP6_MOBILEPREFIX_ADVERT:
printf(", length %u", length);
break;
default:
break;
}
switch (dp->icmp6_type) { switch (dp->icmp6_type) {
case ICMP6_DST_UNREACH: case ICMP6_DST_UNREACH: