diff options
author | Anders Broman <anders.broman@ericsson.com> | 2013-09-10 06:06:55 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2013-09-10 06:06:55 +0000 |
commit | 0bb9585cd6083ea9dea855c8faa4626b0af4be65 (patch) | |
tree | 572085b61aa4a961efbef29a2eb4d111b7605bd4 /epan/dissectors/packet-ieee802a.c | |
parent | 60aaa2d8424e22f182d5308d35cc09ca8d956b6e (diff) |
Freom Dennis:
As I looked into the implementation in epan/dissectors/packet-ieee802a.c, there's a bug in the dissect_ieee802a(). After OUI and PID is parsed, it looks for the customized sub-dissector_table by
oui_info = (oui_info_t *)g_hash_table_lookup(oui_info_table, GUINT_TO_POINTER(oui))
The problem is that the oui is defined as an array (guint8 oui[3]), whose value contains the 3-byte customized OUI. However, here GUINT_TO_POINTER(oui) converts the local array oui's address to the hash table key, instead of the value. That cause the search in the hash table to fail, because the ieee802_add_oui() use the OUI value as the key.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9122
svn path=/trunk/; revision=51918
Diffstat (limited to 'epan/dissectors/packet-ieee802a.c')
-rw-r--r-- | epan/dissectors/packet-ieee802a.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-ieee802a.c b/epan/dissectors/packet-ieee802a.c index 609e327861..af5c9dd6fc 100644 --- a/epan/dissectors/packet-ieee802a.c +++ b/epan/dissectors/packet-ieee802a.c @@ -85,6 +85,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) tvbuff_t *next_tvb; const gchar *manuf; guint8 oui[3]; + guint32 oui32; guint16 pid; oui_info_t *oui_info; dissector_table_t subdissector_table; @@ -99,6 +100,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) } tvb_memcpy(tvb, oui, 0, 3); + oui32 = oui[0] << 16 | oui[1] << 8 | oui[2]; manuf = get_manuf_name_if_known(oui); pid = tvb_get_ntohs(tvb, 3); @@ -107,7 +109,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) manuf ? manuf : "Unknown", pid); proto_tree_add_uint_format_value(ieee802a_tree, hf_ieee802a_oui, - tvb, 0, 3, oui[0] << 16 | oui[1] << 8 | oui[2], "%s (%s)", + tvb, 0, 3, oui32, "%s (%s)", bytes_to_str_punct(oui, 3, ':'), manuf ? manuf : "Unknown"); /* @@ -115,7 +117,7 @@ dissect_ieee802a(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) */ if (oui_info_table != NULL && (oui_info = (oui_info_t *)g_hash_table_lookup(oui_info_table, - GUINT_TO_POINTER(oui))) != NULL) { + GUINT_TO_POINTER(oui32))) != NULL) { /* * Yes - use it. */ |