diff options
author | Mark Vitale <mvitale@sinenomine.net> | 2020-03-03 16:23:12 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2020-03-09 06:29:28 +0000 |
commit | 78b08dd00ae62245a68dea4ff47c4f857912ff67 (patch) | |
tree | e594c812c6225801120150ba1665f9ce76210549 /epan/dissectors/packet-afs.c | |
parent | 3cf85db1f968cf92f003efa37386c97f3adfe2c1 (diff) |
afs: make defragment / reassembly configurable
AFS reassembly support was added by commit
64d9c005f96ffa2eabb8f3b4edafba9cffe32d87. However, it was always on and
could not be disabled; this can cause unacceptable performance issues
with large packet traces.
Instead, add a configuration option for tshark:
-o afs_defragment:true or false (false by default)
Also, add a Wireshark preference pane item for AFS:
[ ] "Reassemble fragmented AFS PDUs" (off by default)
Change-Id: I9b8f2a7c7821214c15a2a27292f2f4006ce8efa3
Reviewed-on: https://code.wireshark.org/review/36299
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-afs.c')
-rw-r--r-- | epan/dissectors/packet-afs.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/epan/dissectors/packet-afs.c b/epan/dissectors/packet-afs.c index 055f4124ac..4c518cd8ce 100644 --- a/epan/dissectors/packet-afs.c +++ b/epan/dissectors/packet-afs.c @@ -31,6 +31,9 @@ /* Forward declarations */ void proto_register_afs(void); +/* Defragment (reassemble) fragmented AFS traffic */ +static gboolean afs_defragment = FALSE; + #define AFS_PORT_FS 7000 #define AFS_PORT_CB 7001 #define AFS_PORT_PROT 7002 @@ -2886,7 +2889,7 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) afs_tree = proto_item_add_subtree(ti, ett_afs); save_fragmented = pinfo->fragmented; - if( (! (rxinfo->flags & RX_LAST_PACKET) || rxinfo->seq > 1 )) { /* Fragmented */ + if( (afs_defragment && (!(rxinfo->flags & RX_LAST_PACKET) || rxinfo->seq > 1 ))) { /* Fragmented */ tvbuff_t * new_tvb = NULL; fragment_head * frag_msg = NULL; guint32 afs_seqid = rxinfo->callnumber ^ rxinfo->cid; @@ -2909,7 +2912,6 @@ dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data) return tvb_captured_length(tvb); } } - pinfo->fragmented = save_fragmented; if (tree) { @@ -3605,6 +3607,8 @@ proto_register_afs(void) &ett_afs_cm_capabilities, }; + module_t *afs_module; + proto_afs = proto_register_protocol("Andrew File System (AFS)", "AFS (RX)", "afs"); proto_register_field_array(proto_afs, hf, array_length(hf)); @@ -3615,7 +3619,13 @@ proto_register_afs(void) afs_request_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), afs_hash, afs_equal); + afs_module = prefs_register_protocol(proto_afs, NULL); + prefs_register_bool_preference(afs_module, "defragment", + "Reassemble fragmented AFS PDUs", + "Whether fragmented AFS PDUs should be reassembled", &afs_defragment); + register_dissector("afs", dissect_afs, proto_afs); + } /* |