X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/0d2d222ffb8fdca529963a11624f4390d1c15297..05ec05a87b3a7c6983a16b5ae62d0f1512c4ce89:/print-ip.c diff --git a/print-ip.c b/print-ip.c index a7d95eb9..494eb295 100644 --- a/print-ip.c +++ b/print-ip.c @@ -350,7 +350,7 @@ again: ipds->nh = enh & 0xff; goto again; } - + case IPPROTO_IPCOMP: { int enh; @@ -370,25 +370,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 @@ -405,11 +405,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; @@ -434,7 +434,7 @@ again: return; } break; - + #ifdef INET6 case IPPROTO_IPV6: /* ip6-in-ip encapsulation */ @@ -477,20 +477,12 @@ again: } break; -#ifdef HAVE_NET_PFVAR_H - case IPPROTO_PFSYNC: - pfsync_ip_print(ipds->cp, - (int)(snapend - (u_char *)ipds->ip) - IP_HL(ipds->ip) * 4, - (const u_char *)ipds->ip); - break; -#endif - case IPPROTO_PGM: pgm_print(ipds->cp, ipds->len, (const u_char *)ipds->ip); 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)); @@ -498,7 +490,7 @@ again: break; } } - + void ip_print_inner(netdissect_options *ndo, const u_char *bp, @@ -605,7 +597,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. @@ -673,7 +665,7 @@ ip_print(netdissect_options *ndo, (void)printf(" %s", proto->p_name); else (void)printf(" ip-proto-%d", ipds->ip->ip_p); - } + } } }