summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2013-04-15 13:56:20 -0400
committerMichael Mann <mmann78@netscape.net>2014-11-06 20:33:14 +0000
commit28e19b6b2333f21091a2dba462b1b87b7e7f1edb (patch)
treefeaf4d41a99f0d8cb068426164ef6e1f72ac4465
parent255f1c09fd7675863bf9ce70efe3dfd25c3626da (diff)
downloadwireshark-28e19b6b2333f21091a2dba462b1b87b7e7f1edb.tar.gz
nfs: parse full setclientid CLID_INUSE reply
Note there can be some extra data in the CLID_INUSE case. (Future work: dissect_nfs_clientaddr4 could use some improvement.) Ping-Bug: 10649 Change-Id: I92f34c6cc7a9328458f1e4391b04009f5e47290b Reviewed-on: https://code.wireshark.org/review/5141 Reviewed-by: Bruce Fields <jbrucefields@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--epan/dissectors/packet-nfs.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index e54b4f6434..db9a94185d 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -7533,20 +7533,20 @@ dissect_nfs4_clientaddr(tvbuff_t *tvb, int offset, proto_tree *tree)
/* IPv4: h1.h2.h3.h4.p1.p2 */
port = (b5<<8) | b6;
proto_tree_add_text(tree, tvb, addr_offset, offset-addr_offset,
- "[callback IPv4 address %u.%u.%u.%u, protocol=%s, port=%u]",
+ "[IPv4 address %u.%u.%u.%u, protocol=%s, port=%u]",
b1, b2, b3, b4, protocol, port);
} else if (universal_ip_address && sscanf(universal_ip_address, "%u.%u",
&b1, &b2) == 2) {
/* Some clients (linux) sometimes send only the port. */
port = (b1<<8) | b2;
proto_tree_add_text(tree, tvb, addr_offset, offset-addr_offset,
- "[callback ip address NOT SPECIFIED, protocol=%s, port=%u]", protocol, port);
+ "[ip address NOT SPECIFIED, protocol=%s, port=%u]", protocol, port);
} else if (universal_ip_address && sscanf(universal_ip_address,
"%2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x.%u.%u",
&b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &b9, &b10) == 10) {
port = (b9<<8) | b10;
proto_tree_add_text(tree, tvb, addr_offset, offset-addr_offset,
- "[callback IPv6 address %2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x, protocol=%s, port=%u]",
+ "[IPv6 address %2x:%2x:%2x:%2x:%2x:%2x:%2x:%2x, protocol=%s, port=%u]",
b1, b2, b3, b4, b5, b6, b7, b8, protocol, port);
} else {
proto_tree_add_text(tree, tvb, addr_offset, offset-addr_offset, "[Invalid address]");
@@ -9497,14 +9497,15 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
}
/*
- * With the exception of NFS4_OP_LOCK, NFS4_OP_LOCKT, and
- * NFS4_OP_SETATTR, all other ops do *not* return data with the
- * failed status code.
+ * With the exception of NFS4_OP_LOCK, NFS4_OP_LOCKT,
+ * NFS4_OP_SETATTR, and NFS4_OP_SETCLIENTID, all other
+ * ops do *not* return data with the failed status code.
*/
if (status != NFS4_OK
&& opcode != NFS4_OP_LOCK
&& opcode != NFS4_OP_LOCKT
- && opcode != NFS4_OP_SETATTR) {
+ && opcode != NFS4_OP_SETATTR
+ && opcode != NFS4_OP_SETCLIENTID) {
op_summary[ops_counter].iserror = TRUE;
continue;
}
@@ -9615,10 +9616,17 @@ dissect_nfs4_response_op(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tr
break;
case NFS4_OP_SETCLIENTID:
- offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_clientid,
- offset);
- offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_verifier,
- offset);
+ if (status == NFS4_OK) {
+ offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_clientid,
+ offset);
+ offset = dissect_rpc_uint64(tvb, newftree, hf_nfs4_verifier,
+ offset);
+ } else if (status == NFS4ERR_CLID_INUSE)
+ /*
+ * XXX: below function actually assumes
+ * this is for a callback. Fix:
+ */
+ offset = dissect_nfs4_clientaddr(tvb, offset, newftree);
break;
case NFS4_OP_WRITE: