diff options
author | delphij <delphij@FreeBSD.org> | 2012-10-05 20:19:28 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2012-10-05 20:19:28 +0000 |
commit | dca5e2df844aab1432db6569445dc152e22cb279 (patch) | |
tree | 9869d83ad1eec4a1fa6e21d5865136e11aa5f9c0 /contrib/tcpdump/print-ip.c | |
parent | a130b811b9a9a99ca8b02c74857b7fa5be4a6e2a (diff) | |
parent | 69fe8a0033b22318969c85b57837b48863946665 (diff) | |
download | FreeBSD-src-dca5e2df844aab1432db6569445dc152e22cb279.zip FreeBSD-src-dca5e2df844aab1432db6569445dc152e22cb279.tar.gz |
MFV: tcpdump 4.3.0.
MFC after: 4 weeks
Diffstat (limited to 'contrib/tcpdump/print-ip.c')
-rw-r--r-- | contrib/tcpdump/print-ip.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/contrib/tcpdump/print-ip.c b/contrib/tcpdump/print-ip.c index 1ef4ee3..bc6cbcc 100644 --- a/contrib/tcpdump/print-ip.c +++ b/contrib/tcpdump/print-ip.c @@ -352,7 +352,7 @@ again: ipds->nh = enh & 0xff; goto again; } - + case IPPROTO_IPCOMP: { int enh; @@ -372,25 +372,25 @@ again: case IPPROTO_DCCP: dccp_print(ipds->cp, (const u_char *)ipds->ip, ipds->len); break; - + case IPPROTO_TCP: /* pass on the MF bit plus the offset to detect fragments */ tcp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip, ipds->off & (IP_MF|IP_OFFMASK)); break; - + case IPPROTO_UDP: /* pass on the MF bit plus the offset to detect fragments */ udp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip, ipds->off & (IP_MF|IP_OFFMASK)); break; - + case IPPROTO_ICMP: /* pass on the MF bit plus the offset to detect fragments */ icmp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip, ipds->off & (IP_MF|IP_OFFMASK)); break; - + case IPPROTO_PIGP: /* * XXX - the current IANA protocol number assignments @@ -407,11 +407,11 @@ again: */ igrp_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); break; - + case IPPROTO_EIGRP: eigrp_print(ipds->cp, ipds->len); break; - + case IPPROTO_ND: ND_PRINT((ndo, " nd %d", ipds->len)); break; @@ -436,7 +436,7 @@ again: return; } break; - + #ifdef INET6 case IPPROTO_IPV6: /* ip6-in-ip encapsulation */ @@ -488,7 +488,7 @@ again: break; default: - if ((proto = getprotobynumber(ipds->nh)) != NULL) + if (ndo->ndo_nflag==0 && (proto = getprotobynumber(ipds->nh)) != NULL) ND_PRINT((ndo, " %s", proto->p_name)); else ND_PRINT((ndo, " ip-proto-%d", ipds->nh)); @@ -496,7 +496,7 @@ again: break; } } - + void ip_print_inner(netdissect_options *ndo, const u_char *bp, @@ -603,7 +603,7 @@ ip_print(netdissect_options *ndo, } if (ipds->ip->ip_ttl >= 1) - (void)printf(", ttl %u", ipds->ip->ip_ttl); + (void)printf(", ttl %u", ipds->ip->ip_ttl); /* * for the firewall guys, print id, offset. @@ -667,11 +667,11 @@ ip_print(netdissect_options *ndo, if (ipds->off & 0x1fff) { (void)printf("%s > %s:", ipaddr_string(&ipds->ip->ip_src), ipaddr_string(&ipds->ip->ip_dst)); - if ((proto = getprotobynumber(ipds->ip->ip_p)) != NULL) + if (!ndo->ndo_nflag && (proto = getprotobynumber(ipds->ip->ip_p)) != NULL) (void)printf(" %s", proto->p_name); else (void)printf(" ip-proto-%d", ipds->ip->ip_p); - } + } } } |