[PATCH v2] test: add a simple signal agent script
by James Prestwood
Creates a signal agent and registers for levels passed
in on the command line, or a default set of levels.
---
test/signal-agent | 64 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
create mode 100755 test/signal-agent
v2:
* Added support for passing in levels on the command line
* Changed default levels to match iwctl
diff --git a/test/signal-agent b/test/signal-agent
new file mode 100755
index 00000000..fb1b6873
--- /dev/null
+++ b/test/signal-agent
@@ -0,0 +1,64 @@
+#!/usr/bin/python3
+
+from gi.repository import GLib
+
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import sys
+import time
+import signal
+
+def signal_handler(sig, frame):
+ exit(0)
+
+class SignalAgent(dbus.service.Object):
+ def __init__(self):
+ self._bus = dbus.SystemBus()
+ self._path = '/test/agent/' + str(int(round(time.time() * 1000)))
+
+ dbus.service.Object.__init__(self, self._bus, self._path)
+
+ @property
+ def path(self):
+ return self._path
+
+ @dbus.service.method('net.connman.iwd.SignalLevelAgent',
+ in_signature='', out_signature='')
+ def Release(self):
+ print("SignalAgent released")
+
+ @dbus.service.method('net.connman.iwd.SignalLevelAgent',
+ in_signature='oy', out_signature='')
+ def Changed(self, path, level):
+ self.handle_new_level(str(path), int(level))
+
+ def handle_new_level(self, path, level):
+ print("New signal level %d" % level)
+
+if __name__ == '__main__':
+ level_range = [-60, -67, -75]
+
+ if len(sys.argv) < 2 or len(sys.argv) > 3:
+ print("Usage: %s <device path> [dBm ranges]" % sys.argv[0])
+ print("Example: %s /net/connman/iwd/0/10 -65,-70,-75" % sys.argv[0])
+ quit()
+
+ if len(sys.argv) == 3:
+ level_range = [int(x) for x in sys.argv[2].split(',') if int(x) < 0]
+
+ signal.signal(signal.SIGINT, signal_handler)
+
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SystemBus()
+ agent = SignalAgent()
+
+ station_if = dbus.Interface(bus.get_object('net.connman.iwd', sys.argv[1]),
+ 'net.connman.iwd.Station')
+ station_if.RegisterSignalLevelAgent(agent.path,
+ dbus.Array(level_range, 'n'))
+
+ mainloop = GLib.MainLoop()
+ mainloop.run()
+
--
2.26.2
1 year, 3 months
[PATCH] test: add a simple signal agent script
by James Prestwood
Creates a signal agent and registers for a few levels.
---
test/signal-agent | 52 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
create mode 100755 test/signal-agent
diff --git a/test/signal-agent b/test/signal-agent
new file mode 100755
index 00000000..65f16cfd
--- /dev/null
+++ b/test/signal-agent
@@ -0,0 +1,52 @@
+#!/usr/bin/python3
+
+from gi.repository import GLib
+
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import sys
+import time
+
+class SignalAgent(dbus.service.Object):
+ def __init__(self):
+ self._bus = dbus.SystemBus()
+ self._path = '/test/agent/' + str(int(round(time.time() * 1000)))
+
+ dbus.service.Object.__init__(self, self._bus, self._path)
+
+ @property
+ def path(self):
+ return self._path
+
+ @dbus.service.method('net.connman.iwd.SignalLevelAgent',
+ in_signature='', out_signature='')
+ def Release(self):
+ print("SignalAgent released")
+
+ @dbus.service.method('net.connman.iwd.SignalLevelAgent',
+ in_signature='oy', out_signature='')
+ def Changed(self, path, level):
+ self.handle_new_level(str(path), int(level))
+
+ def handle_new_level(self, path, level):
+ print("New signal level %d" % level)
+
+if __name__ == '__main__':
+ if len(sys.argv) < 2:
+ print("Usage: %s <device path>" % sys.argv[0])
+ quit()
+
+ dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+
+ bus = dbus.SystemBus()
+ agent = SignalAgent()
+
+ station_if = dbus.Interface(bus.get_object('net.connman.iwd', sys.argv[1]),
+ 'net.connman.iwd.Station')
+ station_if.RegisterSignalLevelAgent(agent.path,
+ dbus.Array([-70, -75, -80], 'n'))
+
+ mainloop = GLib.MainLoop()
+ mainloop.run()
+
--
2.26.2
1 year, 3 months
[PATCH] netdev: always register for single CQM threshold
by James Prestwood
If the extended feature for CQM levels was not supported no CQM
registration would happen, not even for a single level. This
caused IWD to completely lose the ability to roam since it would
only get notified when the kernel was disconnecting, around -90
dBm, not giving IWD enough time to roam.
Instead if the extended feature is not supported we can still
register for the event, just without multiple signal levels.
---
src/netdev.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/netdev.c b/src/netdev.c
index 7a10bf0e..1f2aa51c 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -4427,9 +4427,10 @@ static int netdev_cqm_rssi_update(struct netdev *netdev)
if (!wiphy_has_ext_feature(netdev->wiphy,
NL80211_EXT_FEATURE_CQM_RSSI_LIST))
- return 0;
-
- msg = netdev_build_cmd_cqm_rssi_update(netdev, netdev->rssi_levels,
+ msg = netdev_build_cmd_cqm_rssi_update(netdev, NULL, 0);
+ else
+ msg = netdev_build_cmd_cqm_rssi_update(netdev,
+ netdev->rssi_levels,
netdev->rssi_levels_num);
if (!msg)
return -EINVAL;
--
2.26.2
1 year, 3 months
[PATCH] crypto: Check for l_cipher_decrypt error
by Andrew Zaborowski
---
src/crypto.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/crypto.c b/src/crypto.c
index 563f17ce..6c70eb9a 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -167,12 +167,18 @@ bool aes_unwrap(const uint8_t *kek, size_t kek_len, const uint8_t *in, size_t le
for (i = n; i >= 1; i--, t--) {
b[0] ^= L_CPU_TO_BE64(t);
b[1] = L_GET_UNALIGNED(r);
- l_cipher_decrypt(cipher, b, b, 16);
+
+ if (!l_cipher_decrypt(cipher, b, b, 16)) {
+ b[0] = 0;
+ goto done;
+ }
+
L_PUT_UNALIGNED(b[1], r);
r -= 1;
}
}
+done:
l_cipher_free(cipher);
explicit_bzero(&b[1], 8);
--
2.27.0
1 year, 3 months
Reconnect issues, still
by KeithG
The group at connman has re-written connman and it now leverages the
background scanning in iwd as it allows the setting of 'AutoConnect=true'
now. That definitely helps, but I am still struggling to get the RPIs to
effortlessly reconnect. As it is, I have to manipulate the interface to
force a reconnect (if down/up) by running a script to check if the
interface is up or down.
For whatever reason, a reconnect is never tried unless we restart the iwd
or connman process or restart the interface. What I see is my android
devices reconnect in < 1 minute if I force a disconnect from the router or
restart the radio or reboot. I am running the latest git of iwd
(r5144.074bc52). I force disconnect from the router at 18:32. Then I wait.
spg3 is my SSID. It scans and 'sees' it but never initiates or tries a
re-connect. If I do this with my phone (Android 10), it is reconnected in
less than 2 minutes. If I let iwd control it, it reconnects in < 2 minutes
as well. Is there something that connman is waiting for to let connman know
it is ready?
disconnect at 18:43:38 and reconnect at 18:45:06
Feb 07 18:43:27 rune64 iwd[2387]:
src/station.c:station_early_neighbor_report_cb() ifindex: 3, error:
-110(Connection timed out)
Feb 07 18:43:38 rune64 iwd[2387]: src/netdev.c:netdev_link_notify() event
16 on ifindex 3
Feb 07 18:43:38 rune64 iwd[2387]: src/netdev.c:netdev_link_notify() event
16 on ifindex 3
Feb 07 18:43:38 rune64 iwd[2387]: src/netdev.c:netdev_mlme_notify() MLME
notification Disconnect(48)
Feb 07 18:43:38 rune64 iwd[2387]: src/netdev.c:netdev_disconnect_event()
Feb 07 18:43:38 rune64 iwd[2387]: Received Deauthentication event, reason:
5, from_ap: false
Feb 07 18:43:38 rune64 iwd[2387]: src/station.c:station_disconnect_event() 3
Feb 07 18:43:38 rune64 iwd[2387]: src/station.c:station_disassociated() 3
Feb 07 18:43:38 rune64 iwd[2387]: src/resolve.c:resolve_systemd_revert()
ifindex: 3
Feb 07 18:43:38 rune64 iwd[2387]: WARNING:
src/resolve.c:resolve_systemd_revert() condition !systemd_state.is_ready
failed
Feb 07 18:43:38 rune64 iwd[2387]: src/station.c:station_enter_state() Old
State: connected, new state: disconnected
Feb 07 18:43:38 rune64 iwd[2387]: src/station.c:station_enter_state() Old
State: disconnected, new state: autoconnect_quick
Feb 07 18:43:38 rune64 iwd[2387]: src/wiphy.c:wiphy_radio_work_insert()
Inserting work item 3
Feb 07 18:43:38 rune64 iwd[2387]: src/wiphy.c:wiphy_radio_work_next()
Starting work item 3
Feb 07 18:43:38 rune64 iwd[2387]:
src/netconfig.c:netconfig_ifaddr_deleted() ifaddr 192.168.2.41/24
Feb 07 18:43:38 rune64 iwd[2387]: src/wiphy.c:wiphy_reg_notify()
Notification of command Reg Change(36)
Feb 07 18:43:38 rune64 iwd[2387]: src/wiphy.c:wiphy_update_reg_domain() New
reg domain country code for (global) is XX
...
Feb 07 18:45:06 rune64 iwd[2387]: src/station.c:station_autoconnect_next()
Considering autoconnecting to BSS '08:02:8e:94:12:97' with SSID: spg3,
freq: 5180, rank: 13866, strength: -5000
Feb 07 18:45:06 rune64 iwd[2387]: src/wiphy.c:wiphy_radio_work_insert()
Inserting work item 10
Feb 07 18:45:06 rune64 iwd[2387]: src/station.c:__station_connect_network()
connecting to BSS 08:02:8e:94:12:97
Feb 07 18:45:06 rune64 iwd[2387]: src/station.c:station_enter_state() Old
State: autoconnect_full, new state: connecting
Feb 07 18:45:06 rune64 iwd[2387]: src/scan.c:scan_periodic_stop() Stopping
periodic scan for wdev 1
Feb 07 18:45:06 rune64 iwd[2387]: src/scan.c:scan_cancel() Trying to cancel
scan id 9 for wdev 1
Feb 07 18:45:06 rune64 iwd[2387]: src/wiphy.c:wiphy_radio_work_done() Work
item 9 done
Feb 07 18:45:06 rune64 iwd[2387]: src/wiphy.c:wiphy_radio_work_next()
Starting work item 10
Feb 07 18:45:06 rune64 iwd[2387]: src/station.c:station_netdev_event()
Associating
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_mlme_notify() MLME
notification Connect(46)
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_connect_event()
Feb 07 18:45:06 rune64 iwd[2387]: src/eapol.c:eapol_handle_ptk_1_of_4()
ifindex=3
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_link_notify() event
16 on ifindex 3
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_link_notify() event
16 on ifindex 3
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_link_notify() event
16 on ifindex 3
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_link_notify() event
16 on ifindex 3
Feb 07 18:45:06 rune64 iwd[2387]: src/eapol.c:eapol_handle_ptk_3_of_4()
ifindex=3
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_set_gtk() 3
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_set_igtk() 3
Feb 07 18:45:06 rune64 iwd[2387]: src/station.c:station_handshake_event()
Setting keys
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_set_tk() 3
Feb 07 18:45:06 rune64 iwd[2387]: src/station.c:station_connect_cb() 3,
result: 0
Feb 07 18:45:06 rune64 iwd[2387]:
src/netconfig.c:netconfig_ipv6_select_and_install() IPV6 configuration
disabled
Feb 07 18:45:06 rune64 iwd[2387]: src/wiphy.c:wiphy_radio_work_done() Work
item 10 done
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_mlme_notify() MLME
notification Frame TX Status(60)
Feb 07 18:45:06 rune64 iwd[2387]: src/frame-xchg.c:frame_xchg_mlme_notify()
Received no ACK
Feb 07 18:45:06 rune64 iwd[2387]: src/netdev.c:netdev_link_notify() event
16 on ifindex 3
Feb 07 18:45:06 rune64 iwd[2387]:
src/netconfig.c:netconfig_ipv4_dhcp_event_handler() DHCPv4 event 0
Feb 07 18:45:06 rune64 iwd[2387]: src/netconfig.c:netconfig_ifaddr_added()
wlan0: ifaddr 192.168.2.41/24 broadcast 192.168.2.255
If I try the same thing with connman controlling it, it 'sees' the SSID,
but never triggers connman to reconnect. Should connman be looking for
something? If I restart iwd, it immediately connects. I get a ton of:
src/station.c:station_add_seen_bss()
and it even reports my SSID, but it never connects until I reset the
interface or restart iwd.
Feb 07 18:54:17 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:17 rune64 iwd[265]: src/scan.c:get_scan_done() get_scan_done
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '08:02:8e:94:12:97' with SSID: spg3, freq: 5180, rank:
15209, strength: -5100
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '08:02:8e:94:12:98' with SSID: spg2, freq: 2462, rank: 5631,
strength: -4300
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '10:da:43:a0:f5:a4' with SSID: NETGEAR63, freq: 2462, rank:
3317, strength: -6500
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS 'ac:3a:7a:0c:83:0b' with SSID: , freq: 2462, rank: 3009,
strength: -6100
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss() BSS
has hidden SSID
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '24:4b:fe:24:a5:b8' with SSID: Virus, freq: 2412, rank:
2899, strength: -7100
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '6c:19:8f:ce:6f:a2' with SSID: Edventures3, freq: 5785,
rank: 2448, strength: -7300
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '6c:19:8f:ce:6f:a0' with SSID: Edventures, freq: 2412, rank:
2441, strength: -6800
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '40:2b:50:95:61:60' with SSID: ATTXIXISpi, freq: 2412, rank:
2322, strength: -7000
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '84:bb:69:71:19:30' with SSID: ElJefe, freq: 2437, rank:
2102, strength: -7200
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS 'a0:04:60:6c:4d:40' with SSID: HouseStark01, freq: 2442,
rank: 1571, strength: -8200
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '06:93:97:4e:01:43' with SSID: ATTxZIQ4wa, freq: 5805, rank:
936, strength: -8700
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '7e:ac:b9:55:92:a9' with SSID: , freq: 5745, rank: 792,
strength: -8900
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss() BSS
has hidden SSID
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '04:d9:f5:bb:b4:58' with SSID: HANNA, freq: 2427, rank:
1941, strength: -7800
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '06:93:97:09:ca:93' with SSID: ATTeHeTKI2, freq: 5765, rank:
1036, strength: -8800
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '74:ac:b9:55:92:a9' with SSID: Loading..., freq: 5745, rank:
936, strength: -8700
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '94:e3:6d:6a:96:aa' with SSID: Chime-6a96aa, freq: 2412,
rank: 270, strength: -8200
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '10:93:97:4e:01:40' with SSID: ATTxZIQ4wa, freq: 2412, rank:
1858, strength: -7500
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS '10:da:43:a0:f5:a5' with SSID: NETGEAR63-5G, freq: 5765,
rank: 1577, strength: -8200
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS 'f4:c1:14:b2:4d:8e' with SSID: BidenHarris, freq: 5240,
rank: 1296, strength: -8500
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS 'f6:c1:14:ba:4d:8b' with SSID: , freq: 5240, rank: 1296,
strength: -8500
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss() BSS
has hidden SSID
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss()
Processing BSS 'f6:c1:14:ba:4d:89' with SSID: , freq: 5240, rank: 1296,
strength: -8500
Feb 07 18:54:17 rune64 iwd[265]: src/station.c:station_add_seen_bss() BSS
has hidden SSID
Feb 07 18:54:17 rune64 iwd[265]: src/wiphy.c:wiphy_radio_work_insert()
Inserting work item 19
Feb 07 18:54:17 rune64 iwd[265]: src/wiphy.c:wiphy_radio_work_done() Work
item 18 done
Feb 07 18:54:17 rune64 iwd[265]: src/wiphy.c:wiphy_radio_work_next()
Starting work item 19
Feb 07 18:54:17 rune64 iwd[265]: src/scan.c:scan_notify() Scan notification
Trigger Scan(33)
Feb 07 18:54:17 rune64 iwd[265]: src/scan.c:scan_request_triggered()
Passive scan triggered for wdev 1
Feb 07 18:54:17 rune64 iwd[265]:
src/station.c:station_dbus_scan_triggered() station_scan_triggered: 0
Feb 07 18:54:17 rune64 iwd[265]:
src/station.c:station_dbus_scan_triggered() Scan triggered for wlan0 subset
1
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:scan_notify() Scan notification
New Scan Results(34)
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 6/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 51/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 41/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 35/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 67/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 157/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 34/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 65/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 102/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 28/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 31/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 31/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 31/255
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_advertisement_protocol()
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 31/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 11/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_callback()
get_scan_callback
Feb 07 18:54:21 rune64 iwd[265]:
src/scan.c:scan_parse_bss_information_elements() Load: 11/255
Feb 07 18:54:21 rune64 iwd[265]: src/scan.c:get_scan_done() get_scan_done
It just repeats this over and over again until I either reset the interface
or restart either connman or iwd. How can I help to debug this? Is it a
kernel issue? What is the trigger that is supposed to get an external
process to negotiate the interface connection?
Keith
1 year, 3 months
[PATCH v2] client: remove warning on mkdir return
by James Prestwood
This fixes up a previous commit which breaks iwctl. The
check was added to satisfy static analysis but it ended
up preventing iwctl from starting. In this case mkdir
can fail (e.g. if the directory already exists) and only
if it fails should the history be read. Otherwise a
successful mkdir return indicates the history folder is
new and there is no reason to try reading it.
---
client/display.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/client/display.c b/client/display.c
index 4b9ee8f0..07cb7bda 100644
--- a/client/display.c
+++ b/client/display.c
@@ -681,7 +681,6 @@ void display_init(void)
{
const char *data_home;
char *data_path;
- int ret;
display_refresh.redo_entries = l_queue_new();
@@ -702,16 +701,15 @@ void display_init(void)
}
if (data_path) {
- ret = mkdir(data_path, 0700);
- /* Not much can be done since display isn't even initialized */
- if (L_WARN_ON(ret < 0)) {
- l_free(data_path);
- return;
+ /*
+ * If mkdir succeeds that means its a new directory, no need
+ * to read the history since it doesn't exist
+ */
+ if (mkdir(data_path, 0700) != 0) {
+ history_path = l_strdup_printf("%s/history", data_path);
+ read_history(history_path);
}
- history_path = l_strdup_printf("%s/history", data_path);
- read_history(history_path);
-
l_free(data_path);
} else {
history_path = NULL;
--
2.26.2
1 year, 3 months
[PATCH] client: remove warning on mkdir return
by James Prestwood
This reverts a previous commit which breaks iwctl. The
check was added to satisfy static analysis but it ended
up preventing iwctl from starting. In this case mkdir
can fail (e.g. if the directory already exists).
---
client/display.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/client/display.c b/client/display.c
index 4b9ee8f0..961ad419 100644
--- a/client/display.c
+++ b/client/display.c
@@ -681,7 +681,6 @@ void display_init(void)
{
const char *data_home;
char *data_path;
- int ret;
display_refresh.redo_entries = l_queue_new();
@@ -702,12 +701,7 @@ void display_init(void)
}
if (data_path) {
- ret = mkdir(data_path, 0700);
- /* Not much can be done since display isn't even initialized */
- if (L_WARN_ON(ret < 0)) {
- l_free(data_path);
- return;
- }
+ mkdir(data_path, 0700);
history_path = l_strdup_printf("%s/history", data_path);
read_history(history_path);
--
2.26.2
1 year, 3 months
[PATCH] unit: test-sae: zero out frame buffers
by James Prestwood
Not all the authenticate frame elements are set and were assumed
to be zero. Since alloca does not memset data it needs to be
done explicitly.
---
unit/test-sae.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/unit/test-sae.c b/unit/test-sae.c
index 2d984160..10367cf9 100644
--- a/unit/test-sae.c
+++ b/unit/test-sae.c
@@ -202,6 +202,7 @@ static size_t setup_auth_frame(struct authenticate_frame *frame,
uint16_t trans, uint16_t status,
const uint8_t *data, size_t len)
{
+ memset(frame, 0, sizeof(struct authenticate_frame));
memcpy(frame->hdr.address_2, addr, 6);
frame->hdr.fc.type = MPDU_TYPE_MANAGEMENT;
--
2.26.2
1 year, 3 months
[PATCH v2] network: free psk on error
by James Prestwood
---
src/network.c | 2 ++
1 file changed, 2 insertions(+)
v2:
* Free psk in all cases as its never used past this point
diff --git a/src/network.c b/src/network.c
index 7cae413f..5a8d93ee 100644
--- a/src/network.c
+++ b/src/network.c
@@ -399,6 +399,8 @@ static int network_load_psk(struct network *network, bool need_passphrase)
return 0;
}
+ l_free(psk);
+
path = storage_get_network_file_path(security, ssid);
l_error("%s: invalid PreSharedKey format", path);
l_free(path);
--
2.26.2
1 year, 3 months
[PATCH 1/3] eap: warn on too small of buffer
by James Prestwood
In practice a caller will know the contents of their buffer,
but just in case it would be nice to print a warning. This
may not satisfy static analysis, but at least with this the
developer will be informed what they are doing is wrong.
---
src/eap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/eap.c b/src/eap.c
index dea0c3cf..39c950a2 100644
--- a/src/eap.c
+++ b/src/eap.c
@@ -167,6 +167,9 @@ static void eap_send_response(struct eap_state *eap, enum eap_type type,
buf[4] = type;
if (type == EAP_TYPE_EXPANDED) {
+ if (L_WARN_ON(len < 12))
+ return;
+
memcpy(buf + 5, eap->method->vendor_id, 3);
l_put_be32(eap->method->vendor_type, buf + 8);
}
--
2.26.2
1 year, 3 months