aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee80211.c
diff options
context:
space:
mode:
authorChuck Craft <bubbasnmp@gmail.com>2022-11-01 12:49:52 -0500
committerA Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2022-11-10 12:22:31 +0000
commitb032a40fd94435b05d216fc2945003d68a1b551c (patch)
tree8597d9941a876bee3d6449811808a9d2ee4f6351 /epan/dissectors/packet-ieee80211.c
parentc34223ad6219d2baffefbc05c72cffa3946988bb (diff)
IEEE 802.11: random addresses in conversations and endpoints
https://ask.wireshark.org/question/29235/ MAC addresses shown in WLAN statistics do not appear in the capture! Initialize the address types then check if set when tapping.
Diffstat (limited to 'epan/dissectors/packet-ieee80211.c')
-rw-r--r--epan/dissectors/packet-ieee80211.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index f765b23124..e03088a421 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -8021,10 +8021,15 @@ wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_,
conv_hash_t *hash = (conv_hash_t*) pct;
hash->flags = flags;
const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
+ tap_packet_status status = TAP_PACKET_DONT_REDRAW;
- add_conversation_table_data(hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &wlan_ct_dissector_info, CONVERSATION_NONE);
+ if ((whdr->src.type != AT_NONE) && (whdr->dst.type != AT_NONE)) {
+ add_conversation_table_data(hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &wlan_ct_dissector_info, CONVERSATION_NONE);
- return TAP_PACKET_REDRAW;
+ status = TAP_PACKET_REDRAW;
+ }
+
+ return status;
}
static const char*
@@ -8044,14 +8049,22 @@ wlan_endpoint_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, con
conv_hash_t *hash = (conv_hash_t*) pit;
hash->flags = flags;
const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
+ tap_packet_status status = TAP_PACKET_DONT_REDRAW;
/* Take two "add" passes per packet, adding for each direction, ensures that all
packets are counted properly (even if address is sending to itself)
XXX - this could probably be done more efficiently inside endpoint_table */
- add_endpoint_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_endpoint_dissector_info, ENDPOINT_NONE);
- add_endpoint_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_endpoint_dissector_info, ENDPOINT_NONE);
+ if (whdr->src.type != AT_NONE) {
+ add_endpoint_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_endpoint_dissector_info, ENDPOINT_NONE);
+ status = TAP_PACKET_REDRAW;
+ }
+
+ if (whdr->dst.type != AT_NONE) {
+ add_endpoint_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_endpoint_dissector_info, ENDPOINT_NONE);
+ status = TAP_PACKET_REDRAW;
+ }
- return TAP_PACKET_REDRAW;
+ return status;
}
static const char*
@@ -35214,6 +35227,7 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, GINT_TO_POINTER(isDMG));
+ memset(&whdrs[0], 0, sizeof(wlan_hdr_t) * 4);
whdr= &whdrs[0];
p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_S1G_KEY, GINT_TO_POINTER(isS1G));