diff options
author | Anders Broman <anders.broman@ericsson.com> | 2010-08-03 17:08:52 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2010-08-03 17:08:52 +0000 |
commit | 0848d851cff4fcfc0d71772da517a543844e5558 (patch) | |
tree | 15f9d19239f7885049bb55c1379a7db8a41983c9 | |
parent | dff27826ec176b10d195aebb82493b965c108e42 (diff) |
From Slava:
The Infiniband dissector currently uses a heuristic where it attempts to parse
IBA payloads as if they contained encapsulated traffic with an Ethertype
header. While a relatively common occurrence and thus a fairly useful feature,
this heuristic in many cases causes false-positives which invoke unneeded
dissectors and generate noise in the form of unjustified "malformed packet"
errors these dissectors cause. This patch adds a checkbox to the Infiniband
preferences menu that allows users to disable this feature if desired. The
option remains on by default.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5062
svn path=/trunk/; revision=33703
-rw-r--r-- | epan/dissectors/packet-infiniband.c | 14 | ||||
-rw-r--r-- | epan/dissectors/packet-infiniband.h | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c index 61a4e7953a..11baacec25 100644 --- a/epan/dissectors/packet-infiniband.c +++ b/epan/dissectors/packet-infiniband.c @@ -34,6 +34,7 @@ #include <epan/proto.h> #include <epan/emem.h> #include <epan/dissectors/packet-frame.h> +#include <epan/prefs.h> #include <epan/etypes.h> #include <string.h> #include "packet-infiniband.h" @@ -972,6 +973,7 @@ static void parse_PAYLOAD(proto_tree *parentTree, packet_info *pinfo, tvbuff_t * * similar to the RWH header. There is no way to identify these frames * positively. * + * If the appropriate option is set in protocol preferences, * We see if the first few bytes look like an EtherType header, and if so * call the appropriate dissector. If not we call the "data" dissector. */ @@ -979,7 +981,7 @@ static void parse_PAYLOAD(proto_tree *parentTree, packet_info *pinfo, tvbuff_t * etype = tvb_get_ntohs(tvb, local_offset); reserved = tvb_get_ntohs(tvb, local_offset + 2); - if (reserved == 0) { + if (pref_identify_iba_payload && reserved == 0) { /* Get the captured length and reported length of the data after the Ethernet type. */ @@ -3351,6 +3353,8 @@ skip_lrh: /* Protocol Registration */ void proto_register_infiniband(void) { + module_t *infiniband_module; + /* Field dissector structures. * For reserved fields, reservedX denotes the reserved field is X bits in length. * e.g. reserved2 is a reserved field 2 bits in length. @@ -5265,6 +5269,14 @@ void proto_register_infiniband(void) proto_register_field_array(proto_infiniband, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + /* register dissection preferences */ + infiniband_module = prefs_register_protocol(proto_infiniband, NULL); + + prefs_register_bool_preference(infiniband_module, "identify_payload", + "Attempt to identify and parse encapsulated IBA payloads", + "When set, dissector will attempt to identify unknown IBA payloads " + "as containing an encapsulated ethertype, and parse them accordingly", + &pref_identify_iba_payload); proto_infiniband_link = proto_register_protocol("InfiniBand Link", "InfiniBand Link", "infiniband_link"); register_dissector("infiniband_link", dissect_infiniband_link, proto_infiniband_link); diff --git a/epan/dissectors/packet-infiniband.h b/epan/dissectors/packet-infiniband.h index d4e05cb58d..817b3130f0 100644 --- a/epan/dissectors/packet-infiniband.h +++ b/epan/dissectors/packet-infiniband.h @@ -1378,4 +1378,7 @@ static gchar *src_addr_str = NULL, /* the string to be displayed in the sour #define ADDR_STR_MAX_LEN 33 /* maximum length of src_addr_str and dst_addr_str */ +/* settings to be set by the user via the preferences dialog */ +static gboolean pref_identify_iba_payload = TRUE; + #endif |