]> The Tcpdump Group git mirrors - tcpdump/commitdiff
NFS: Check for all relevant RPC call body fields at the beginning.
authorGuy Harris <[email protected]>
Sun, 5 Mar 2017 19:11:20 +0000 (11:11 -0800)
committerDenis Ovsienko <[email protected]>
Wed, 13 Sep 2017 11:25:44 +0000 (12:25 +0100)
If we don't have the procedure number, we'll give up eventually; might
as well give up before we do any work that'll be thrown away.

print-nfs.c

index 4fd9c3f7dc5e4253e8eab6933751489c5e9afa24..e752a59cf4b9122df2a84ff677a411c84464aa57 100644 (file)
@@ -870,7 +870,7 @@ xid_map_enter(netdissect_options *ndo,
        const struct ip6_hdr *ip6 = NULL;
        struct xid_map_entry *xmep;
 
-       if (!ND_TTEST(rp->rm_call.cb_vers))
+       if (!ND_TTEST(rp->rm_call.cb_proc))
                return (0);
        switch (IP_V((const struct ip *)bp)) {
        case 4:
@@ -899,11 +899,7 @@ xid_map_enter(netdissect_options *ndo,
                UNALIGNED_MEMCPY(&xmep->client, &ip6->ip6_src, sizeof(ip6->ip6_src));
                UNALIGNED_MEMCPY(&xmep->server, &ip6->ip6_dst, sizeof(ip6->ip6_dst));
        }
-       if (!ND_TTEST(rp->rm_call.cb_proc))
-               return (0);
        xmep->proc = EXTRACT_32BITS(&rp->rm_call.cb_proc);
-       if (!ND_TTEST(rp->rm_call.cb_vers))
-               return (0);
        xmep->vers = EXTRACT_32BITS(&rp->rm_call.cb_vers);
        return (1);
 }