mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-26 13:49:35 -05:00
tests: Verify hostapd mgmt_tx() success
Raise an exception if MGMT_TX command to hostapd fails. Previously, such errors were ignored silently. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
1a4b4c8466
commit
0851a180b9
@ -326,7 +326,8 @@ class Hostapd:
|
|||||||
def mgmt_tx(self, msg):
|
def mgmt_tx(self, msg):
|
||||||
t = (msg['fc'], 0) + mac2tuple(msg['da']) + mac2tuple(msg['sa']) + mac2tuple(msg['bssid']) + (0,)
|
t = (msg['fc'], 0) + mac2tuple(msg['da']) + mac2tuple(msg['sa']) + mac2tuple(msg['bssid']) + (0,)
|
||||||
hdr = struct.pack('<HH6B6B6BH', *t)
|
hdr = struct.pack('<HH6B6B6BH', *t)
|
||||||
self.request("MGMT_TX " + binascii.hexlify(hdr + msg['payload']))
|
if "OK" not in self.request("MGMT_TX " + binascii.hexlify(hdr + msg['payload'])):
|
||||||
|
raise Exception("MGMT_TX command to hostapd failed")
|
||||||
|
|
||||||
def get_sta(self, addr, info=None, next=False):
|
def get_sta(self, addr, info=None, next=False):
|
||||||
cmd = "STA-NEXT " if next else "STA "
|
cmd = "STA-NEXT " if next else "STA "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user