X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/663aa08e8b1aa722d9e5907e11591175a3630fb0..230e0b85778df66f9cec62d13f0025c78cc0c9da:/print-udp.c?ds=sidebyside diff --git a/print-udp.c b/print-udp.c index ddc35157..57e5b2bb 100644 --- a/print-udp.c +++ b/print-udp.c @@ -556,6 +556,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, * TCP does, and we do so for UDP-over-IPv6. */ if (IP_V(ip) == 4 && (ndo->ndo_vflag > 1)) { + ND_TCHECK_2(up->uh_sum); udp_sum = EXTRACT_BE_U_2(up->uh_sum); if (udp_sum == 0) { ND_PRINT("[no cksum] "); @@ -574,6 +575,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, /* for IPv6, UDP checksum is mandatory */ if (ND_TTEST_LEN(cp, length)) { sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr)); + ND_TCHECK_2(up->uh_sum); udp_sum = EXTRACT_BE_U_2(up->uh_sum); if (sum != 0) { @@ -613,7 +615,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, else if (IS_SRC_OR_DST_PORT(NTP_PORT)) ntp_print(ndo, (const u_char *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(KERBEROS_PORT) || IS_SRC_OR_DST_PORT(KERBEROS_SEC_PORT)) - krb_print(ndo, (const void *)(up + 1)); + krb_print(ndo, (const u_char *)(up + 1)); else if (IS_SRC_OR_DST_PORT(L2TP_PORT)) l2tp_print(ndo, (const u_char *)(up + 1), length); #ifdef ENABLE_SMB @@ -625,14 +627,14 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, else if (dport == VAT_PORT) vat_print(ndo, (const void *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(ZEPHYR_SRV_PORT) || IS_SRC_OR_DST_PORT(ZEPHYR_CLT_PORT)) - zephyr_print(ndo, (const void *)(up + 1), length); + zephyr_print(ndo, (const u_char *)(up + 1), length); /* * Since there are 10 possible ports to check, I think * a <> test would be more efficient */ else if ((sport >= RX_PORT_LOW && sport <= RX_PORT_HIGH) || (dport >= RX_PORT_LOW && dport <= RX_PORT_HIGH)) - rx_print(ndo, (const void *)(up + 1), length, sport, dport, + rx_print(ndo, (const u_char *)(up + 1), length, sport, dport, (const u_char *) ip); else if (IS_SRC_OR_DST_PORT(RIPNG_PORT)) ripng_print(ndo, (const u_char *)(up + 1), length); @@ -650,7 +652,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length, else if (dport == WB_PORT) wb_print(ndo, (const u_char *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(CISCO_AUTORP_PORT)) - cisco_autorp_print(ndo, (const void *)(up + 1), length); + cisco_autorp_print(ndo, (const u_char *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(RADIUS_PORT) || IS_SRC_OR_DST_PORT(RADIUS_NEW_PORT) || IS_SRC_OR_DST_PORT(RADIUS_ACCOUNTING_PORT) ||