From 7f437c30e3aaf052a5b175cb093a0e5e07963545 Mon Sep 17 00:00:00 2001 From: Tim Kourt Date: Wed, 30 May 2018 16:39:05 -0700 Subject: [PATCH] auto-t: add eapol reauth cmd into hostapd mngr --- autotests/util/hostapd.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py index 5cea7fd7..c199863c 100644 --- a/autotests/util/hostapd.py +++ b/autotests/util/hostapd.py @@ -2,6 +2,7 @@ import os, os.path import wiphy import re +import socket chan_freq_map = [ None, @@ -29,9 +30,9 @@ class HostapdCLI: self.ifname = interface.name self.ctrl_interface = interface.ctrl_interface - socket_path = os.path.dirname(self.ctrl_interface) + self.socket_path = os.path.dirname(self.ctrl_interface) - self.cmdline = 'hostapd_cli -p"' + socket_path + '" -i"' + \ + self.cmdline = 'hostapd_cli -p"' + self.socket_path + '" -i"' + \ self.ifname + '"' self._hostapd_restarted = False @@ -46,6 +47,13 @@ class HostapdCLI: def deauthenticate(self, client_address): os.system(self.cmdline + ' deauthenticate ' + client_address) + def eapol_reauth(self, client_address): + cmd = 'IFNAME=' + self.ifname + ' EAPOL_REAUTH ' + client_address + s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) + s.connect(self.socket_path + '/' + self.ifname) + s.sendall(cmd.encode('utf-8')) + s.close() + def reload(self): # Seemingly all three commands needed for the instance to notice # interface's address change