]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-tcp.c
Use nd_ types, add host-endian extract routines, clean up signed vs. unsigned.
[tcpdump] / print-tcp.c
index 0646caa92706f6108aef7a25eeba07cda9025724..4baaee3ad7e1719106e1d168d906b611ed5a99dd 100644 (file)
@@ -180,7 +180,7 @@ tcp_print(netdissect_options *ndo,
         else
                 ip6 = NULL;
         ch = '\0';
-        if (!ND_TTEST(tp->th_dport)) {
+        if (!ND_TTEST_2(tp->th_dport)) {
                 ND_PRINT("%s > %s: [|tcp]",
                              ipaddr_string(ndo, &ip->ip_src),
                              ipaddr_string(ndo, &ip->ip_dst));
@@ -748,15 +748,17 @@ tcp_print(netdissect_options *ndo,
                 if (fraglen > (length) - 4)
                         fraglen = (length) - 4;
                 rp = (const struct sunrpc_msg *)(bp + 4);
-                if (ND_TTEST(rp->rm_direction)) {
-                        direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(&rp->rm_direction);
+                if (ND_TTEST_4(rp->rm_direction)) {
+                        direction = (enum sunrpc_msg_type) EXTRACT_BE_U_4(rp->rm_direction);
                         if (dport == NFS_PORT && direction == SUNRPC_CALL) {
-                                ND_PRINT(": NFS request xid %u ", EXTRACT_BE_U_4(&rp->rm_xid));
+                                ND_PRINT(": NFS request xid %u ",
+                                         EXTRACT_BE_U_4(rp->rm_xid));
                                 nfsreq_noaddr_print(ndo, (const u_char *)rp, fraglen, (const u_char *)ip);
                                 return;
                         }
                         if (sport == NFS_PORT && direction == SUNRPC_REPLY) {
-                                ND_PRINT(": NFS reply xid %u ", EXTRACT_BE_U_4(&rp->rm_xid));
+                                ND_PRINT(": NFS reply xid %u ",
+                                         EXTRACT_BE_U_4(rp->rm_xid));
                                 nfsreply_noaddr_print(ndo, (const u_char *)rp, fraglen, (const u_char *)ip);
                                 return;
                         }