From patchwork Fri Jan 11 09:44:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fanchaoting X-Patchwork-Id: 1965381 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D57293FE37 for ; Fri, 11 Jan 2013 09:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753908Ab3AKJnu (ORCPT ); Fri, 11 Jan 2013 04:43:50 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:22390 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753570Ab3AKJnt (ORCPT ); Fri, 11 Jan 2013 04:43:49 -0500 X-IronPort-AV: E=Sophos;i="4.84,451,1355068800"; d="pcap'?scan'208";a="6567336" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 11 Jan 2013 17:41:45 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r0B9hkQ8005568; Fri, 11 Jan 2013 17:43:47 +0800 Received: from [127.0.0.1] ([10.167.225.240]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013011117431066-864323 ; Fri, 11 Jan 2013 17:43:10 +0800 Message-ID: <50EFDEEA.4040201@cn.fujitsu.com> Date: Fri, 11 Jan 2013 17:44:10 +0800 From: fanchaoting User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: "linux-nfs@vger.kernel.org" , wireshark-dev@wireshark.org Subject: [PATCH] wireshark: can't decode callback if didn't caught CREATE_SESSION and SETCLIENTID packets before X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/01/11 17:43:10, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/01/11 17:43:10 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org now i found that nfs kernel use 0x40000000 as callback program number. the CREATE_SESSION and SETCLIENTID use 0x40000000 as callback program number, and they didn't change it. but i found that i use wireshark to decode nfsv4 callback procedures, it didn't decode them if the wireshark or tcpdump didn't caught CREATE_SESSION and SETCLIENTID packets before. Signed-off-by: Fan Chaoting --- epan/dissectors/packet-nfs.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 63d1019..7b5ec88 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -7979,10 +7979,7 @@ dissect_nfs_cb_client4(tvbuff_t *tvb, int offset, proto_tree *tree) { proto_tree *cb_location = NULL; proto_item *fitem = NULL; - int cbprog; - cbprog = tvb_get_ntohl(tvb, offset); - reg_callback(cbprog); offset = dissect_rpc_uint32(tvb, tree, hf_nfs_cb_program, offset); fitem = proto_tree_add_text(tree, tvb, offset, 0, "cb_location"); @@ -8991,7 +8988,6 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *ftree = NULL; proto_tree *newftree = NULL; guint32 string_length; - int cbprog; const char *name = NULL, *source_name = NULL, *dest_name=NULL; const char *opname=NULL; guint32 last_fh_hash=0; @@ -9012,6 +9008,10 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo, "Operations (count: %u)", ops); offset += 4; + /*Now the nfs use '0x40000000' as callback's program number.*/ +#define CB_PROG 0x40000000 + reg_callback(CB_PROG); + #define MAX_NFSV4_OPS 128 if (ops > MAX_NFSV4_OPS) { @@ -9469,8 +9469,6 @@ dissect_nfs_argop4(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_nfs_create_session_flags(tvb, offset, newftree, hf_nfs_create_session_flags_csa); offset = dissect_rpc_chanattrs4(tvb, offset, newftree, "csa_fore_chan_attrs"); offset = dissect_rpc_chanattrs4(tvb, offset, newftree, "csa_back_chan_attrs"); - cbprog = tvb_get_ntohl(tvb, offset); - reg_callback(cbprog); offset = dissect_rpc_uint32(tvb, newftree, hf_nfs_cb_program, offset); offset = dissect_rpc_secparms4(tvb, offset, newftree); break;