eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit f6683bab753f59a0339a0c141500ad8c924188d6
parent 58d2814a92858cd86f3de2c0e05b7dfa9ed24bb0
Author: James Prestwood <prestwoj@gmail.com>
Date:   Mon, 23 Aug 2021 11:32:19 -0700

auto-t: hwsim.py: convert addresses to 42:* format

mac80211_hwsim has a funny quirk with multiple addresses in
radios. Some operations require address index zero, some index
one. And these addresses (possibly a result of how test-runner
initializes radios) sometimes get mixed up. For example scan
results may show a BSS address as 02:00:00:00:00:00, while the
next test run shows 42:00:00:00:00:00.

Ultimately, sending out frames requires the first nibble of the
address to be 0x4 so to handle both variants of addresses described
above hwsim.py was updated to always bitwise OR the first byte
with 0x40.

Diffstat:
Mautotests/util/hwsim.py | 16++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/autotests/util/hwsim.py b/autotests/util/hwsim.py @@ -335,14 +335,26 @@ class Hwsim(iwd.AsyncOpAbstract): def object_manager(self): return self._object_manager_if + @staticmethod + def _convert_address(address): + first = int(address[0:2], base=16) + first |= 0x40 + first = format(first, 'x') + + address = first + address[2:] + + return address + def spoof_disassociate(self, radio, freq, station): ''' Send a spoofed disassociate frame to a station ''' + dest = self._convert_address(radio.addresses[0].replace(':', '')) + frame = 'a0 00 3a 01' frame += station.replace(':', '') - frame += radio.addresses[0].replace(':', '') - frame += radio.addresses[0].replace(':', '') + frame += dest + frame += dest frame += '30 01 07 00' self.spoof_frame(radio, freq, station, frame)