From: Guy Harris Date: Mon, 25 May 2020 04:01:26 +0000 (-0700) Subject: Merge branch 'master' into fix_udp_frag_badlen X-Git-Tag: tcpdump-4.99-bp~386^2 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/64e8f9a9ed91a3cbfa8e66367f87ef50a1d62b99 Merge branch 'master' into fix_udp_frag_badlen --- 64e8f9a9ed91a3cbfa8e66367f87ef50a1d62b99 diff --cc print-udp.c index b4e8271d,b5254f0c..961b6f8f --- a/print-udp.c +++ b/print-udp.c @@@ -683,25 -724,34 +724,34 @@@ udp_print(netdissect_options *ndo, cons lisp_print(ndo, (const u_char *)(up + 1), length); else if (IS_SRC_OR_DST_PORT(VXLAN_GPE_PORT)) vxlan_gpe_print(ndo, (const u_char *)(up + 1), length); - else if (ND_TTEST(((const struct LAP *)cp)->type) && - ((const struct LAP *)cp)->type == lapDDP && - (atalk_port(sport) || atalk_port(dport))) { + else if (IS_SRC_OR_DST_PORT(ZEP_PORT)) + zep_print(ndo, (const u_char *)(up + 1), length); + else if (IS_SRC_OR_DST_PORT(MPLS_PORT)) + mpls_print(ndo, (const u_char *)(up + 1), length); + else if (ND_TTEST_1(((const struct LAP *)cp)->type) && + GET_U_1(((const struct LAP *)cp)->type) == lapDDP && + (atalk_port(sport) || atalk_port(dport))) { if (ndo->ndo_vflag) - ND_PRINT((ndo, "kip ")); + ND_PRINT("kip "); llap_print(ndo, cp, length); - } else { + } else if (IS_SRC_OR_DST_PORT(PTP_EVENT_PORT) || + IS_SRC_OR_DST_PORT(PTP_GENERAL_PORT)) { + ptp_print(ndo, cp, length); + } else if (IS_SRC_OR_DST_PORT(SOMEIP_PORT)) + someip_print(ndo, (const u_char *)(up + 1), length); + else { - if (ulen > length) + if (ulen > length && !fragmented) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + ND_PRINT("UDP, bad length %u > %u", + ulen, length); else - ND_PRINT((ndo, "UDP, length %u", ulen)); + ND_PRINT("UDP, length %u", ulen); } } else { - if (ulen > length) + if (ulen > length && !fragmented) - ND_PRINT((ndo, "UDP, bad length %u > %u", - ulen, length)); + ND_PRINT("UDP, bad length %u > %u", + ulen, length); else - ND_PRINT((ndo, "UDP, length %u", ulen)); + ND_PRINT("UDP, length %u", ulen); } return;