]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udp.c
Allow tcpdump to work with earlier libpcaps.
[tcpdump] / print-udp.c
index c9627b4b7fa98f94c70925a21ec20604bf1ed872..a95683ec45a48341d5567886b670850151ecc745 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.85 2000-10-07 05:53:14 itojun Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-udp.c,v 1.89 2000-11-17 19:08:16 itojun Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -30,7 +30,6 @@ static const char rcsid[] =
 
 #include <sys/param.h>
 #include <sys/time.h>
-#include <sys/socket.h>
 
 #include <netinet/in.h>
 
@@ -416,7 +415,8 @@ static int udp6_cksum(const struct ip6_hdr *ip6, const struct udphdr *up,
 #endif
 
 void
-udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
+udp_print(register const u_char *bp, u_int length,
+         register const u_char *bp2, int fragmented)
 {
        register const struct udphdr *up;
        register const struct ip *ip;
@@ -565,7 +565,7 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
                    (atalk_port(sport) || atalk_port(dport))) {
                        if (vflag)
                                fputs("kip ", stdout);
-                       atalk_print(cp, length);
+                       llap_print(cp, length);
                        return;
                }
        }
@@ -602,7 +602,7 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
        }
 #endif
 
-       if (IP_V(ip) == 4 && vflag) {
+       if (IP_V(ip) == 4 && vflag && !fragmented) {
                int sum = up->uh_sum;
                if (sum == 0) {
                        (void)printf(" [no cksum]");
@@ -615,7 +615,7 @@ udp_print(register const u_char *bp, u_int length, register const u_char *bp2)
                }
        }
 #ifdef INET6
-       if (IP_V(ip) == 6 && ip6->ip6_plen && vflag) {
+       if (IP_V(ip) == 6 && ip6->ip6_plen && vflag && !fragmented) {
                int sum = up->uh_sum;
                /* for IPv6, UDP checksum is mandatory */
                if (TTEST2(cp[0], length)) {