Commit Graph

6458 Commits

Author SHA1 Message Date
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
James Prestwood 392eebc0a9 auto-t: iwd.py: fix re-scanning bug on get_ordered_networks
Certain scenarios coupled with lost beacons could result in OrderedNetwork
being initialized many times until the dbus library reached its maximum
signal registrations. This could happen where there are two networks,
IWD finds one in a scan but continues to scan for the other and the beacons
are lost. The way get_ordered_networks was written it returns early if any
networks are found. Since get_ordered_network (not plural) uses
get_ordered_networks() in a loop this caused OrderedNetwork's to be created
rapidly until python raises an exception.

To fix this, pass an optional list of networks being looked for to
get_ordered_networks. Only if all the networks in the list are found will
it return early, otherwise it will continue to scan.
2021-11-02 16:14:28 -05:00
James Prestwood 4e61d04e0d client: special case daemon interface for non-interactive
In non-interactive mode, when a dbus method call returns the process
exits. This is true for all methods except agent requests since e.g.
Connect() call automatically requests credentials and the client must
wait for that to return before exiting. The new daemon interface must
also be treated in the same way and not exit.
2021-11-02 16:14:21 -05:00
Marcel Holtmann ae03fcb50d Release 1.19 2021-11-02 19:49:42 +01:00
Marcel Holtmann 6450f3ea3f build: Fix wrong order in ChangeLog 2021-11-02 19:46:41 +01:00
Marcel Holtmann 5651117f86 build: Require at least version 0.45 when building with external ELL 2021-11-02 15:53:51 +01:00
James Prestwood 762f9f2533 test-runner: fix qemu warning for newer versions
warning: short-form boolean option 'readonly' deprecated
Please use readonly=on instead
2021-10-28 12:25:52 -05:00
James Prestwood 89407089cd test-runner: handle pyroute2 IW() between versions
It appears different versions of pyroute2 may or may not have
iwutil, and instead use pyroute2.IW() directly. Try the iwutil
way first, then pyroute2.IW()
2021-10-28 12:25:52 -05:00
James Prestwood 4d66e11b0c test-runner: add support for PCI passthrough
Adding back in PCI passthrough support
2021-10-28 12:25:52 -05:00
James Prestwood 3a47181a50 netdev: add SA Query delay with OCV enabled
The way a SA Query was done following a channel switch was slightly
incorrect. One because it is only needed when OCVC is set, and two
because IWD was not waiting a random delay between 0 and 5000us as
lined out by the spec. This patch fixes both these issues.
2021-10-26 17:16:38 -05:00
James Prestwood 39ba0a9ebd test-runner: allow wpa_supplicant to be used in --hw mode
This lets test-runner's physical adapter pass-through to be used with
wpa_supplicant.
2021-10-26 17:16:34 -05:00
Denis Kenzior 4b1ce76549 client: Don't try to print addresses if not connected 2021-10-26 14:34:00 -05:00
Denis Kenzior 062fc7852a client: Only print daemon info in interactive mode 2021-10-26 07:48:33 -05:00
Denis Kenzior 93a06769c4 client: Print IP Addresses / hint about netconfig
When station 'show' is invoked, parse and print any IP addresses
associated with the interface.

If iwd network configuration is disabled and no IP addresses were
configured, print a hint to the user that a DHCP client might need to be
configured.
2021-10-25 17:25:18 -05:00
Denis Kenzior 48b0a95528 client: Print daemon information at startup 2021-10-25 17:24:51 -05:00
Denis Kenzior 6a477061c7 unit: Consistently use network-byte-order
Commit ed10b00afa ("unit: Fix eapol IP Allocation test failure")
did not convert all instances of IP allocation settings to network byte
order.

Fixes: 5c9de0cf23 ("eapol: Store IP address in network byte order")
2021-10-25 10:39:00 -05:00
Andrew Zaborowski 0971eb4d0c netconfig: Convert netconfig_load_settings to use _auto_
As requested do the cleanup in netconfig_load_settings using ell's
private _auto_() macro.
2021-10-22 12:12:17 -05:00
Andrew Zaborowski f0a85ddeb4 netconfig: Track local domains lists
Cache the latest v4 and v6 domain string lists in struct netconfig state
to be able to more easily detect changes in those values in future
commits.  For that split netconfig_set_domains's code into this function,
which now only commits the values in netconfig->v{4,6}_domain{,s} to the
resolver, and netconfig_domains_update() which figures out the active
domains string list and saves it into netconfig->v{4,6}_domain{,s}.  This
probably saves some cycles as the callers can now decide to only
recalculate the domains list which may have changed.

While there simplify netconfig_set_domains return type to void as the
result was always 0 anyway and was never checked by callers.
2021-10-22 12:12:17 -05:00
Andrew Zaborowski 2b1b8cce54 netconfig: Track DNS address string lists
Cache the latest v4 and v6 DNS IP string lists in struct netconfig state
to be able to more easily detect changes in those values in future
commits.  For that split netconfig_set_dns's code into this function,
which now only commit the values in netconfig->dns{4,6}_list to the
resolver, and netconfig_dns_list_update() which figures out the active
DNS IP address list and saves it in netconfig->dns{4,6} list.  This
probably saves some cycles as the callers can now decide to only
recalculate the dns_list which may have changed.

While there simplify netconfig_set_dns return type to void as the result
was always 0 anyway and was never checked by callers.
2021-10-22 12:12:17 -05:00