Commit Graph

6076 Commits

Author SHA1 Message Date
James Prestwood e6b4354530 wiphy: update wiphy_radio_work_is_running to return int
This differentiates between pending, running, and non-existent:
false, true, -ENOENT respectively
2021-12-06 14:10:03 -06:00
Andrew Zaborowski 7ecdee6eaa autotests: p2p: Make waiting for dhclient more reliable
Make sure we wipe the leases file both for server and client, so that
dhclient doesn't try to re-use leases from previous tests (should really
happen) and waste time waiting for a reply.  Extend the timeout from 1s
to 5s, sometimes it takes dhclient 1s just to start.  Disable verbose
mode if not needed to avoid dhclient stalling if the pipe is not being
read.
2021-11-30 15:49:08 -06:00
James Prestwood cd15a1698b build: update unit tests with util.c/band.c dependency 2021-11-30 12:29:49 -06:00
James Prestwood 94cdbb4669 scan: add scan_freq_set_to_fixed_array
This serializes a scan_freq_set into a uint32_t array.
2021-11-30 12:29:46 -06:00
James Prestwood 9c732cb32d scan: move scan_freq_set* into util
This will allow scan_freq_set utilities to be used in any
modules requiring unit testing
2021-11-30 12:29:06 -06:00
James Prestwood 24494e978c scan: remove scan APIs refactored into band.c 2021-11-29 17:08:32 -06:00
James Prestwood 56ea2c4d15 treewide: update scan utility usage to use band_* 2021-11-29 17:07:44 -06:00
James Prestwood f3c9b66f08 band: move several scan utilities into band
This will allow unit testing modules which depend on these
APIs:

scan_channel_to_freq
scan_freq_to_channel
scan_oper_class_to_band
2021-11-29 17:07:10 -06:00
James Prestwood 945710fae1 scan: parse configurator connectivity element
This element has no data and indicates the AP supports configuring
stations via DPP while also serving current stations.
2021-11-29 17:03:31 -06:00
James Prestwood 5ab1a1298f ie: add DPP configurator connectivity element 2021-11-29 17:03:21 -06:00
James Prestwood 61dfa943c6 auto-t: testPSK-roam deauthenticate IWD after roam
After roaming deauth IWD and check the connection state.
2021-11-23 12:19:18 -06:00
James Prestwood 7103bda058 netdev: always honor disconnect events if issued by AP
The disconnect event handler was mistakenly bailing out if FT or
reassociation was going on. This was done because a disconnect
event is sent by the kernel when CMD_AUTH/CMD_ASSOC is used.

The problem is an AP could also disconnect IWD which should never
be ignored.

To fix this always parse the disconnect event and, if issued by
the AP, always notify watchers of the disconnect.
2021-11-23 12:18:08 -06:00
James Prestwood aed383b037 wiphy: make wiphy work queue reentrancy safe
Now both the do_work and destroy callback can safely insert new
work items without causing problems.
2021-11-22 15:29:51 -06:00
James Prestwood 44faa81a06 auto-t: iwd.py: use args[0] for station debug interface
Passing *args, **kwargs into StationDebug ended up initializing the
class with Station properties since devices can be initialized from
existing property dictionaries. Since the object path is all
StationDebug needs, pass args[0] instead.
2021-11-22 15:29:42 -06:00
James Prestwood 876fe9f210 crypto: use void* for hkdf_expand
This makes it more flexible for other storage types
2021-11-22 15:29:31 -06:00
James Prestwood b735c90c42 crypto: use void* args for aes_siv_{encrypt,decrypt}
This makes these APIs more flexible for other storage types
2021-11-22 15:29:27 -06:00
Marcel Holtmann 88c786093b Release 1.20 2021-11-18 21:17:44 +01:00
Marcel Holtmann af30466867 build: Require at least version 0.46 when building with external ELL 2021-11-18 21:10:52 +01:00
Denis Kenzior 83cfaee59a doc: Mark NetworkConfigurationAgent API experimental 2021-11-11 14:35:25 -06:00
Torsten Schmitz f82422cc63 gitignore: Add tags and cscope files
Ignore files generated by the make targets tags and cscope.
2021-11-11 14:32:38 -06:00
Torsten Schmitz 22c77cc037 auto-t: replace ifconfig with ip commands
ifconfig has long been deprecated in favor of ip from iproute2.
It is usually no longer installed by default.
2021-11-11 14:29:54 -06:00
Fangrui Song fa1c12453b build: treewide: Set retain attribute
LLD 13 and GNU ld 2.37 support -z start-stop-gc which allows garbage
collection of C identifier name sections despite the __start_/__stop_
references. GNU ld before 2015-10 had the behavior as well. Simply set
the retain attribute so that GCC 11 (if configure-time binutils is 2.36
or newer)/Clang 13 will set the SHF_GNU_RETAIN section attribute to
prevent garbage collection.

Without the patch, there are linker errors with -z start-stop-gc
(LLD default) when -Wl,--gc-sections is used:

```
ld.lld: error: undefined symbol: __start___eap
>>> referenced by eap.c
>>>               src/eap.o:(eap_init)
```

The remain attribute will not be needed if the metadata sections are
referenced by code directly.
2021-11-11 14:27:33 -06:00
Andrew Zaborowski 9cd1f8a7df doc: Add NetworkConfigurationAgent API description
Document the new API that clients can use to get notified of new network
configuration and be responsible for committing it to the netdev, the
resolver, etc.
2021-11-10 12:03:31 -06:00
Andrew Zaborowski 6ac062d151 netconfig: Move FILS override checks to common functions 2021-11-10 11:54:51 -06:00
Andrew Zaborowski 5e7949c144 netconfig: Split ipv4 route setters
Split this function into two, one for setting the gateway route and one
for setting the subnet route.
2021-11-10 11:25:27 -06:00
Denis Kenzior 76c41775fb doc: Bump test-runner python requirement to 3.9 2021-11-10 09:22:25 -06:00
Denis Kenzior 05ae9689eb auto-t: use tmp radvd pid file
On some systems the default radvd pid file location is not accessible.
Specify it to be under /tmp instead.

While there, enable full radvd debug output so it is logged when
test-runner is invoked with the --log option.
2021-11-10 09:17:17 -06:00
Andrew Zaborowski 005198bf07 doc: Document autotest radvd dependency 2021-11-09 14:32:54 -06:00
Andrew Zaborowski d30fc97815 autotests: Test DHCPv6 client in testNetconfig 2021-11-09 14:32:50 -06:00
Andrew Zaborowski c473290b47 ap: Delay ap_free if called inside event handler
ap.c has been mostly careful to call the event handler at the end of any
externally called function to allow methods like ap_free() to be called
within the handler, but that isn't enough.  For example in
ap_del_station we may end up emitting two events: STATION_REMOVED and
DHCP_LEASE_EXPIRED.  Use a slightly more complicated mechanism to
explicitly guard ap_free calls inside the event handler.

To make it easier, simplify cleanup in ap_assoc_reassoc with the use of
_auto_.

In ap_del_station reorder the actions to send the STATION_REMOVED event
first as the DHCP_LEASE_EXPIRED is a consequence of the former and it
makes sense for the handler to react to it first.
2021-11-09 14:29:52 -06:00
Torsten Schmitz d9cd657135 auto-t: fix testP2P
testP2P was failing with
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/wpa_supplicant.conf'
2021-11-09 14:26:17 -06:00
Denis Kenzior cfd191a803 eap: Silence uninitialized var warning
src/eap.c: In function 'eap_rx_packet':
src/eap.c:419:50: error: 'vendor_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  419 |  (type == EAP_TYPE_EXPANDED && vendor_id == (id) && vendor_type == (t))
      |                                                  ^~
src/eap.c:430:11: note: 'vendor_type' was declared here
  430 |  uint32_t vendor_type;

It isn't clear why GCC complains about vendor_type, but not vendor_id.
But in all cases if type == EAP_TYPE_EXPANDED, then vendor_type and
vendor_id are set.  Silence this spurious warning.
2021-11-08 15:12:25 -06:00
Denis Kenzior 43059d5022 AUTHORS: Mention Torsten's contributions 2021-11-08 13:52:12 -06:00
Torsten Schmitz 5a111ac902 station: Prevent a NULL pointer access
There is an unchecked NULL pointer access in network_has_open_pair.
open_info can be NULL, when out of multiple APs in range that advertise
the same SSID some advertise OWE transition elments and some don't.
2021-11-08 13:51:34 -06:00
James Prestwood 017069bf68 auto-t: add OWE transition test with extra open network
A user reported a crash in situations where there was an OWE transition
pair, with an extra open network using the same SSID but not advertising
the OWE transition IE:

++++++++ backtrace ++++++++
 0x7f199cadf320 in /lib64/libc.so.6
 0x418c08 in network_has_open_pair() at /home/jprestwo/iwd/src/station.c:712
 0x4262ce in scan_finished() at /home/jprestwo/iwd/src/scan.c:1718
 0x4273cd in get_scan_done() at /home/jprestwo/iwd/src/scan.c:1733
 0x47cf7a in destroy_request() at /home/jprestwo/iwd/ell/genl.c:674
 0x479f1c in io_callback() at /home/jprestwo/iwd/ell/io.c:120
 0x47922d in l_main_iterate() at /home/jprestwo/iwd/ell/main.c:472 (discriminator 2)
 0x4792dc in l_main_run() at /home/jprestwo/iwd/ell/main.c:521
 0x47950c in l_main_run_with_signal() at /home/jprestwo/iwd/ell/main.c:649
 0x403e97 in main() at /home/jprestwo/iwd/src/main.c:532
 0x7f199cac9b75 in /lib64/libc.so.6
+++++++++++++++++++++++++++
2021-11-08 13:50:25 -06:00
James Prestwood ea23556a40 scan: use signal strength if bss ranks are equal
If two BSS's end up with the same rank sort them based on signal
strength so IWD still prefers the higher strength BSS.
2021-11-08 13:49:50 -06:00
James Prestwood f85fc4202a anqp: return the request ID rather than true 2021-11-08 11:31:49 -06:00
Denis Kenzior 0082784b49 AUTHORS: Mention Marc-Antoine's contributions 2021-11-08 11:13:21 -06:00
Marc-Antoine Perennou b3991c1a40 eap: Remove nested function use
This allows building iwd with clang
2021-11-08 11:12:37 -06:00
James Prestwood 09f4bd9210 auto-t: add a DGAF Disable hotspot test 2021-11-04 14:30:55 -05:00
James Prestwood ba5f4616d2 station: set sysfs options required by HS2.0 spec
The Hotspot 2.0 spec has some requirements that IWD was missing depending
on a few bits in extended capabilities and the HS2.0 indication element.
These requirements correspond to a few sysfs options that can be set in
the kernel which are now set on CONNECTED and unset on DISCONNECTED.
2021-11-04 14:30:00 -05:00
James Prestwood d4e3ec52b2 scan: keep track of HS20 DGAF Disable bit in scan_bss 2021-11-04 14:29:46 -05:00
James Prestwood 6852cf0a3e ie: parse DGAF Disable bit from HS20 indication element 2021-11-04 14:29:25 -05:00
James Prestwood fd85192a54 scan: parse Proxy ARP bit from extended capabilities 2021-11-04 14:27:55 -05:00
James Prestwood b4c20ef81c netconfig: netconfig_reconfigure check bool for setting ARP
Only set the gateway to the ARP cache if the caller requests.
2021-11-03 17:47:03 -05:00
James Prestwood 873924a027 station: set evict_nocarrier sysfs option during roaming
If the kernel supports evict_nocarrier set this during the roam
to prevent packet delays post roam.
2021-11-03 17:44:25 -05:00
James Prestwood 25936b1365 netconfig: remove sysfs static functions 2021-11-03 17:44:11 -05:00
James Prestwood 6ea58f9fde sysfs: introduce sysfs module
Netconfig was the only user of sysfs but now other modules will
also need it.

Adding existing API for IPv6 settings, a IPv4 and IPv6 'supports'
checker, and a setter for IPv4 settings.
2021-11-03 17:44:00 -05:00
James Prestwood 2c7998e8db test-runner: increase test timeout maximum
The OWE transition tests takes quite a while and sometimes hits the
maximum timeout.
2021-11-02 16:15:08 -05:00
James Prestwood 72dbab789d auto-t: allow testAP to benefit from re-scanning
If a beacon is lost testAP will fail since it did not utilize any
rescanning logic. Now it can use this feature by passing full_scan.
This is required since IWD APs are not known to test-runner like
hostapd APs are.
2021-11-02 16:14:55 -05:00