On Friday, 12 July 2019 09:58:50 CEST Johannes Berg wrote: > On Wed, 2019-07-03 at 11:23 +0200, Sven Eckelmann wrote: > > > > ~/tmp/wireshark/build/run/tshark -r /tmp/hwsim-test-logs/latest/wpas_mesh_max_peering.hwsim0.pcapng -T fields -e wlan.sa -e wlan.mesh.config.cap 'wlan.fc.type_subtype == 8' > > 02:00:00:00:01:00 0x00000009 [...] > > With wireshark 3.0.0: > > > > tshark -r /tmp/hwsim-test-logs/latest/wpas_mesh_max_peering.hwsim0.pcapng -T fields -e wlan.sa -e wlan.mesh.config.cap 'wlan.fc.type_subtype == 8' > > 02:00:00:00:01:00 0x00000001 [...] > > So I had to change the wireshark version (see below) which is used by hostapd. > > (just to document for me what I have forced it to a different version) > > What. +hostap list. > > This makes no sense, is that a tshark bug in one of the versions? Yes (but more a bug in the ieee80211 dissector), see commit f3ef8575d462 ("ieee80211: fix wrong offset for mesh configuration capability bitmask") [1]. I've also attached the pcap in case there are still doubts about my statement. As you can see, it will just fail to parse the mesh peering management element correctly. It should parse the last byte of the element payload but it falls back to parsing the first byte (path selection protocol) as capabilities. See 9.4.2.98 "Mesh Configuration element" from 802.11-2016 for details. There is already a workaround for that in the hostap testcases: if all_cap_one: # It looks like tshark parser was broken at some point for # wlan.mesh.config.cap which is now (tshark 2.6.3) pointing to incorrect # field (same as wlan.mesh.config.ps_protocol). This used to work with # tshark 2.2.6. # # For now, assume the capability field ends up being the last octet of # the frame. one = [0, 0, 0] zero = [0, 0, 0] addrs = [addr0, addr1, addr2] for idx in range(3): addr = addrs[idx] out = run_tshark_json(capfile, filt + " && wlan.sa == " + addr) pkts = json.loads(out) for pkt in pkts: frame = pkt["_source"]["layers"]["frame_raw"][0] cap = int(frame[-2:], 16) if cap & 0x01: one[idx] += 1 else: zero[idx] += 1 logger.info("one: " + str(one)) logger.info("zero: " + str(zero)) But maybe you already spotted the problem - it requires that mesh configuration element is the last element. Which is not the case here - similar to 5GHz tests (where you have most likely a VHT cap/oper element after the meshconf_ie). I hope that this makes more sense now. Kind regards, Sven [1] https://github.com/wireshark/wireshark/commit/f3ef8575d4620a62f1c4609bf14961c3e78993f3
Attachment:
wpas_mesh_max_peering.hwsim0.pcapng.gz
Description: application/pcapng
Attachment:
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap