3 Commits

Author SHA1 Message Date
98bd7bab1a Update hostapd.conf 2021-06-15 15:53:39 +02:00
08d24632a3 Update network.py 2021-06-15 15:51:42 +02:00
7c1b0f7ced Merge pull request #74 from KasperskyLab/dev
PR of the version v0.7-test
2021-06-15 15:37:12 +02:00
2 changed files with 12 additions and 10 deletions

View File

@ -2,11 +2,11 @@ country_code=GB
interface={IFACE} interface={IFACE}
ssid={SSID} ssid={SSID}
hw_mode=g hw_mode=g
channel=7 channel={CHAN}
auth_algs=1 auth_algs=1
wpa=2 wpa=2
wpa_passphrase={PASS} wpa_passphrase={PASS}
wpa_key_mgmt=WPA-PSK wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP wpa_pairwise=TKIP
rsn_pairwise=CCMP rsn_pairwise=CCMP
disassoc_low_ack=0 disassoc_low_ack=0

View File

@ -344,12 +344,14 @@ class Network(object):
Deduce the channel to have for the AP in order to prevent Deduce the channel to have for the AP in order to prevent
kind of jamming between the two wifi interfaces. kind of jamming between the two wifi interfaces.
""" """
if self.iface_out[0] == "w":
# Get the channel of the connected interface
sh = sp.Popen(["iw", self.iface_out, "info"],
stdout=sp.PIPE, stderr=sp.PIPE).communicate()
res = re.search("channel ([0-9]{1,2})", sh[0].decode('utf8'))
chn = res.group(1)
# Get the channel of the connected interface # Return a good candidate.
sh = sp.Popen(["iw", self.iface_out, "info"], return "11" if int(chn) < 7 else "1"
stdout=sp.PIPE, stderr=sp.PIPE).communicate() else:
res = re.search("channel ([0-9]{1,2})", sh[0].decode('utf8')) return "1"
chn = res.group(1)
# Return a good candidate.
return "11" if int(chn) < 7 else "1"