]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udp.c
Merge pull request #760 from leres/master
[tcpdump] / print-udp.c
index 4878b7b47349f59cd236f3c0a0478da962e94050..bf5c7ba52ff4c11794261bf358f97e4c1e7a1a74 100644 (file)
@@ -347,15 +347,15 @@ udpipaddr_print(netdissect_options *ndo, const struct ip *ip, int sport, int dpo
                        } else {
                                ND_PRINT("%s.%s > %s.%s: ",
                                        ip6addr_string(ndo, ip6->ip6_src),
-                                       udpport_string(ndo, sport),
+                                       udpport_string(ndo, (uint16_t)sport),
                                        ip6addr_string(ndo, ip6->ip6_dst),
-                                       udpport_string(ndo, dport));
+                                       udpport_string(ndo, (uint16_t)dport));
                        }
                } else {
                        if (sport != -1) {
                                ND_PRINT("%s > %s: ",
-                                       udpport_string(ndo, sport),
-                                       udpport_string(ndo, dport));
+                                       udpport_string(ndo, (uint16_t)sport),
+                                       udpport_string(ndo, (uint16_t)dport));
                        }
                }
        } else {
@@ -367,15 +367,15 @@ udpipaddr_print(netdissect_options *ndo, const struct ip *ip, int sport, int dpo
                        } else {
                                ND_PRINT("%s.%s > %s.%s: ",
                                        ipaddr_string(ndo, ip->ip_src),
-                                       udpport_string(ndo, sport),
+                                       udpport_string(ndo, (uint16_t)sport),
                                        ipaddr_string(ndo, ip->ip_dst),
-                                       udpport_string(ndo, dport));
+                                       udpport_string(ndo, (uint16_t)dport));
                        }
                } else {
                        if (sport != -1) {
                                ND_PRINT("%s > %s: ",
-                                       udpport_string(ndo, sport),
-                                       udpport_string(ndo, dport));
+                                       udpport_string(ndo, (uint16_t)sport),
+                                       udpport_string(ndo, (uint16_t)dport));
                        }
                }
        }
@@ -571,7 +571,7 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length,
                                        ND_PRINT("[udp sum ok] ");
                        }
                }
-               else if (IP_V(ip) == 6 && ip6->ip6_plen) {
+               else if (IP_V(ip) == 6) {
                        /* for IPv6, UDP checksum is mandatory */
                        if (ND_TTEST_LEN(cp, length)) {
                                sum = udp6_cksum(ndo, ip6, up, length + sizeof(struct udphdr));
@@ -672,6 +672,8 @@ udp_print(netdissect_options *ndo, const u_char *bp, u_int length,
                else if (IS_SRC_OR_DST_PORT(MPLS_LSP_PING_PORT))
                        lspping_print(ndo, (const u_char *)(up + 1), length);
                else if (dport == BFD_CONTROL_PORT ||
+                        dport == BFD_MULTIHOP_PORT ||
+                        dport == BFD_LAG_PORT ||
                         dport == BFD_ECHO_PORT )
                        bfd_print(ndo, (const u_char *)(up+1), length, dport);
                 else if (IS_SRC_OR_DST_PORT(LMP_PORT))