X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/25621613e3a2b7453a066fdf35d46edf88522e44..0f24a43a7e9fbdcff2baae3990939b2bc25d9fd1:/print-ip.c diff --git a/print-ip.c b/print-ip.c index 19b2331b..e1085e96 100644 --- a/print-ip.c +++ b/print-ip.c @@ -99,7 +99,7 @@ ip_finddst(netdissect_options *ndo, const u_char *cp; cp = (const u_char *)(ip + 1); - length = (IP_HL(ip) << 2); + length = IP_HL(ip) * 4; if (length < sizeof(struct ip)) goto trunc; length -= sizeof(struct ip); @@ -138,7 +138,7 @@ trunc: /* * Compute a V4-style checksum by building a pseudoheader. */ -int +uint16_t nextproto4_cksum(netdissect_options *ndo, const struct ip *ip, const uint8_t *data, u_int len, u_int covlen, u_int next_proto) @@ -349,7 +349,8 @@ again: case IPPROTO_AH: if (!ND_TTEST_1(ipds->cp)) { - ND_PRINT("[|AH]"); + ndo->ndo_protocol = "ah"; + nd_print_trunc(ndo); break; } ipds->nh = EXTRACT_U_1(ipds->cp); @@ -558,7 +559,7 @@ ip_print(netdissect_options *ndo, ND_PRINT("IP6, wrong link-layer encapsulation"); else ND_PRINT("IP%u", IP_V(ipds->ip)); - ND_PRINT("%s", istr); + nd_print_invalid(ndo); return; } if (!ndo->ndo_eflag)