aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Flaschel <olaf.flaschel@vestifi.de>2019-03-27 11:59:10 +0100
committerAnders Broman <a.broman58@gmail.com>2019-03-28 11:31:05 +0000
commit5648fd5086933ea30ae92a7d60af444d6e1e7ddc (patch)
treed091284d6b435d267ef546b8297434be49c0e290
parent7d9dc595c0ca475806138bc0f0f02aee0ab9d40c (diff)
IEEE802.11: Fix src and dst address handling for AMSDUs
If the offset for src or dst address is set to 0 it should not be used. Change-Id: I7ea4da49d5fe33e118bbf4cdf9a241083a0d950f Reviewed-on: https://code.wireshark.org/review/32600 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
-rw-r--r--epan/dissectors/packet-ieee80211.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index 715854184a..15bb410f55 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -24132,20 +24132,26 @@ dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
DISSECTOR_ASSERT_NOT_REACHED();
}
-
-
- set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, src_offset);
- copy_address_shallow(&pinfo->src, &pinfo->dl_src);
- set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, dst_offset);
- copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
+ if (src_offset) {
+ set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, src_offset);
+ copy_address_shallow(&pinfo->src, &pinfo->dl_src);
+ }
+ if (dst_offset) {
+ set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, dst_offset);
+ copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
+ }
/* for tap */
if (bssid_offset) {
set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, bssid_offset);
}
- copy_address_shallow(&whdr->src, &pinfo->dl_src);
- copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
+ if (src_offset) {
+ copy_address_shallow(&whdr->src, &pinfo->dl_src);
+ }
+ if (dst_offset) {
+ copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
+ }
seq_control = tvb_get_letohs(tvb, 22);
frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);