Commit graph

850 commits

Author SHA1 Message Date
Thomas Haller
bd95a5c0ec
dns: register NMDnsPlugin instance as wait-obj for shutdown
nm_shutdown_wait_obj_register_object() today has no practical effect.
In the future it will block shutdown until the object gets destroyed.
We will want that NMDnsPlugin gets wrapped up during shut down, before
quitting.
2022-04-15 09:04:28 +02:00
Thomas Haller
54119d4105
dhcp: drop internal systemd DHCPv4 client
This is long replaced by nettools' n-dhcp4 client.
Drop it.

We still require NMDhcpSystemd for the DHCPv6 client.

Note that "[main].dhcp=systemd" now falls back to the internal client.
But this option was undocumented and internal anyway.
2022-04-14 14:51:02 +02:00
Thomas Haller
b1575e814f
dhcp: don't use systemd's dhcp_lease_load() in nettools' n-dhcp4 ip4_start() 2022-04-14 14:51:02 +02:00
Thomas Haller
197e73ac7c
dhcp/dhclient: fix setting "src" attribute for certain routes
Fixes: 2dc7a3d9f9 ('dhcp: set "src" for DHCPv4 routes')
2022-04-13 10:43:27 +02:00
Thomas Haller
8e5f60dfd3
dhcp/nettools: reword code comment in dhcp4_event_cb()
Also drop the "FIXME" tag. There is nothing to fix here.
2022-04-13 10:27:50 +02:00
Thomas Haller
cb98616e02
ndisc/tests: relex check in test_dns_solicit_loop()
Dunno why this happens. Just silence it.

  nm:ERROR:../src/core/ndisc/tests/test-ndisc-fake.c:649:test_dns_solicit_loop: assertion failed (data.counter == 3): (2 == 3)
2022-04-12 18:45:29 +02:00
谢致邦 (XIE Zhibang)
b6eb237a27
supplicant: Disable WPA3 transition mode when PMF is set to disabled
According to WPA3_Specification_v3.0 section 2.3, when operating in
WPA3-Personal transition mode an AP:

- shall set MFPC to 1, MFPR to 0.

Therefore, do not operate in WPA3-Personal transition mode when PMF is set to
disabled. This also provides a way to be compatible with some devices that are
not fully compatible with WPA3-Personal transition mode.

Signed-off-by: 谢致邦 (XIE Zhibang) <Yeking@Red54.com>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1186
2022-04-11 18:55:49 +02:00
Thomas Haller
a850e438a7
glib-aux/tests: avoid invalid prefix length in test_platform_ip_address_pretty_sort_cmp()
Next we are going to assert that the prefix length is valid.
The test needs to have valid prefix lengths too. Adjust.
2022-04-08 15:59:50 +02:00
Thomas Haller
b87afac8e8
all: avoid using global string buffer for to-string methods
These string functions allow to omit the string buffer. This is for
convenience, to use a global (thread-local) buffer. I think that is
error prone and we should drop that "convenience" feature.

At various places, pass a stack allocated buffer.
2022-04-08 15:59:49 +02:00
Thomas Haller
02a8d21e4e
all: use "NM_UTILS_TO_STRING_BUFFER_SIZE" macro 2022-04-08 15:59:49 +02:00
Thomas Haller
deb37401e9
platform: make "now" timestamp an in/out parameter to nmp_utils_lifetime_get()
nmp_utils_lifetime_get() calculates the lifetime of addresses,
and it bases the result on a "now" timestamp.

If you have two addresses and calculate their expiry, then we want to
base it on top of the same "now" timestamp, meaning, we should
only call nm_utils_get_monotonic_timestamp_sec() once. This is also a
performance optimization. But much more importantly, when we make a
comparison at a certain moment, we need that all sides have the same
understanding of the current timestamp.

But nmp_utils_lifetime_get() does not always require the now timestamp.
And the caller doesn't know, whether it will need it (short of knowing
how nmp_utils_lifetime_get() is implemented). So, make the now parameter
an in/out argument. If we pass in an already valid now timestamp, use
that. Otherwise, fetch the current time and also return it.
2022-04-08 15:59:48 +02:00
Thomas Haller
5b779c1ab7
connectivity: handle "NoNameServers" resolved error and don't callback to system resolver
No need to try further. The verdict is clear.

From the log:

  <debug> [1649424031.1507] connectivity: (wlan0,IPv4,427) can't resolve a name via systemd-resolved: GDBus.Error:org.freedesktop.resolve1.NoNameServers: No appropriate name servers or networks for name found
  <debug> [1649424031.1507] connectivity: (wlan0,IPv4,427) start request to 'http://fedoraproject.org/static/hotspot.txt' (try resolving 'fedoraproject.org' using system resolver)
2022-04-08 15:49:29 +02:00
Thomas Haller
62b1f9766a
connectivity: don't clear "concheck.resolve_cancellable" early in systemd_resolved_resolve_cb()
This can lead to a crash. The code might continue to call
system_resolver_resolve(), then it has no more cancellable.
That means, if the task gets cancelled, then the callback
will still return and result in a crash.

There is no need to cancel or clear the cancellable during
normal operation. It will be cleaned up at the end.

This leads to an assertion error (or possibly crash):

  ...
  #6  0x00005584ff461e67 in system_resolver_resolve_cb (source_object=<optimized out>, res=0x5585016b9190, user_data=user_data@entry=0x558501667800) at src/core/nm-connectivity.c:798
  #7  0x00007f348a02419a in g_task_return_now (task=0x5585016b9190) at ../gio/gtask.c:1219
  #8  0x00007f348a0241dd in complete_in_idle_cb (task=task@entry=0x5585016b9190) at ../gio/gtask.c:1233
  #9  0x00007f3489e263eb in g_idle_dispatch (source=0x7f3464001070, callback=0x7f348a0241d0 <complete_in_idle_cb>, user_data=0x5585016b9190) at ../glib/gmain.c:5897
  ...

Fixes: 57d226d3f0 ('connectivity: resolve hostname ourselves to avoid blocking libcurl')
2022-04-08 15:49:29 +02:00
Beniamino Galvani
82980f7791 wifi: disable FT in AP mode
Currently wpa_supplicant doesn't support FT in AP mode. FT-PSK and
FT-EAP are simply not negotiated with the STA. FT-SAE gets negotiated
but then the key derivation is not supported, leading to a
authentication failure.

Even if support for FT in AP mode is introduced in wpa_supplicant in
the future, it will require additional parameters as the nas
identifier and the mobility domain, which are currently not provided
by NM.

Disable all FT key-mgmts in AP mode since they are useless and cause
issues (FT-SAE).

See-also: https://mail.gnome.org/archives/networkmanager-list/2022-March/msg00016.html
See-also: http://lists.infradead.org/pipermail/hostap/2022-April/040352.html

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1184
2022-04-08 15:27:20 +02:00
Thomas Haller
2dc7a3d9f9
dhcp: set "src" for DHCPv4 routes
Let's set the "src" (RTA_PREFSRC) of DHCP routes.
This helps with source address selection.

This can matter if the interface also has static addresses
configured.

Systemd-networkd also does this ([1], [2]).

[1] ac2dce5f36
[2] 5b89bff55f/src/network/networkd-dhcp4.c (L395)

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1995372

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1173
2022-04-07 10:20:46 +02:00
Thomas Haller
91cbbd99b9
ifcfg-rh: move code around in write_8021x_setting()
Makes more sense, to not interrupt the construction of the
phase2_auth string.
2022-04-06 13:47:21 +02:00
Thomas Haller
5f5641d304
ifcfg-rh/trivial: add fixme comments about lossy write/read of properties 2022-04-06 13:47:21 +02:00
Francisco Blas Izquierdo Riera (klondike)
8f7e295cbf bridge: fix reentrant call for bluetooth NAP bridge
Currently NetworkManager fails to establish a NAP bridge because it never gets
out of the stage2.

This is caused because when making the BlueZ callback reentrant we return
NM_ACT_STAGE_RETURN_POSTPONE even after registration has succeeded.

This patch changes registration to a three state automaton instead of a
boolean. This allows distinguishing when we are waiting for registration
to finish and when it is done and therefore ensures that when the stage2
is called again by the callback the result is success so NetworkManager
can proceed to the IP configuration.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1181
2022-04-06 12:23:55 +02:00
Thomas Haller
261d74d881
systemd: merge branch systemd into main
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1178
2022-04-05 15:04:07 +02:00
Fernando Fernandez Mancera
99a6c6eda6 ovs, dpdk: fix creating ovs-interface when the ovs-bridge is netdev
When the ovs-bridge datapath is netdev, OpenvSwitch will not create a
ovs-interface but a tun interface. The ovs-interface device must check
all the link-change signals and check if the link type is tun and the
interface name is the same than the device name. If so, the
ovs-interface device will get the ifindex of the tun device. This allow
NetworkManager to manage the interface properly, modifying MTU,
configuring IPv4/IPv6 and others.

Example:

```
55: ovsbridge-port0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 9000 qdisc fq_codel state UNKNOWN group default qlen 1000
    link/ether fa:fb:07:98:e0:c6 brd ff:ff:ff:ff:ff:ff
    inet 192.168.123.100/24 brd 192.168.123.255 scope global noprefixroute ovsbridge-port0
       valid_lft forever preferred_lft forever
    inet6 fe80::9805:55c4:4c5f:da1c/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
```

https://bugzilla.redhat.com/show_bug.cgi?id=2001792
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1179
2022-04-05 14:07:03 +02:00
Thomas Haller
a892746578
connectivity: only enable verbose libcurl debug logging with "NM_LOG_CONCHECK" environment
For regular operation -- even for `level=TRACE` -- it's just too verbose.
Only enable it if the environment "NM_LOG_CONCHECK=1" is set.

An environment variable is a bit unwieldy to use, but this
is really just for a heavy libcurl debugging session.
2022-04-04 16:09:36 +02:00
Thomas Haller
1dc16931be
connectivity: refactor easy_debug_cb()
It seems nicer to me to choose a message in the switch
and only print at one place.
2022-04-04 16:09:36 +02:00
Thomas Haller
57d226d3f0
connectivity: resolve hostname ourselves to avoid blocking libcurl
Usually we anyway require systemd-resolved to resolve the hostname for
connectivity checking. Only systemd-resolved provides a per-interface
API. Without it, connectivity check (together with bumping the route
metric) has problems.

Anyway. If we had no systemd-resolved or it failed, we would just call
libcurl. That would then try to resolve the name, using whatever resolver
libcurl has enabled. Often that is the threaded resolver, which calls
libc's blocking getaddrinfo() API on a thread.

libcurl has a bug ([1]) that can cause the process to block, waiting to join
the resolver thread:

  #0  0x00007ffff781fb27 in __pthread_timedjoin_ex () at /lib64/libpthread.so.0
  #1  0x00007ffff7c0ac9a in Curl_thread_join () at /lib64/libcurl.so.4
  #2  0x00007ffff7c0d693 in thread_wait_resolv () at /lib64/libcurl.so.4
  #3  0x00007ffff7bf9284 in multi_done () at /lib64/libcurl.so.4
  #4  0x00007ffff7bfb588 in curl_multi_remove_handle () at /lib64/libcurl.so.4
  #5  0x000055555574adc3 in cb_data_complete

That's not acceptable. Resolve the name ourselves using glib's implementation
(which also does getaddrinfo() in a thread). If we fail, we no longer call to
libcurl.

[1] https://github.com/curl/curl/issues/8515

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/312
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/404
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/934
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/970

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1176
2022-04-04 16:02:00 +02:00
Beniamino Galvani
1a7db1d7f7 supplicant: enable WPA3 transition mode only when interface supports PMF
We have some reports of APs that advertise WPA2/WPA3 with
MFP-required=0/MFP-capable=0, and reject the association when the
client doesn't support 802.11w.

According to WPA3_Specification_v3.0 section 2.3, when operating in
WPA3-Personal transition mode a STA:

- should allow AKM suite selector: 00-0F-AC:6 (WPA-PSK-SHA256) to be
  selected for an association;

- shall negotiate PMF when associating to an AP using SAE.

The first is guaranteed by capability PMF; the second by checking that
the interface supports BIP ciphers suitable for PMF.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/964
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1003907
2022-04-04 10:43:24 +02:00
Beniamino Galvani
cd1e0193ab supplicant: add BIP interface capability
Introduce a new capability indicating whether the interface supports
any of the BIP ciphers that can be used for 802.11w (PMF).
2022-04-04 10:43:24 +02:00
Thomas Haller
588ac2e2e4
dhcp: add code comment to lease_parse_routes() 2022-04-04 09:56:19 +02:00
Vojtech Bubela
b676202816
bridge: update bridge options with netlink instead of sysfs
sysfs is old so when bridge options are modified changes will
be sent to kernel via netlink message instead.
2022-04-02 22:39:07 +02:00
Vojtech Bubela
9b4bf36bf1
bridge: move initialization of NMPlatformLnkBridge from NMSettingBridge to separate function
Move initialization of NMSettingBridge from NMPlatformLnkBridge to separate
function.

This is needed because this initialization will be used in more than one
function.
2022-04-02 22:39:03 +02:00
Thomas Haller
976e2eeb93
device: cleanup code path in nm_device_get_ip_iface_identifier() 2022-04-02 13:33:00 +02:00
Thomas Haller
eaba1f30a6
core: don't update connection timestamps periodically every 300 seconds
We store the timestamp when a profile activated the last time to
"/var/lib/NetworkManager/timestamps". There was also a timer which
would update the timestamp of activated connections every 300 seconds.

That seems unnecessary, drop it.

For one, waking up every 5 minutes and rewriting a file to disk seems
undesirable, for example if /var is a device where unnecessary writes
should be minimized.

Note that we already update the timestamp when a device goes down,
and of course when it comes up. Updating the timestamp in between seems
unnecessary.

This reverts commit 607350294d ('core: update timestamp in active
system connections every 5 mins (bgo #583756)').

An alternative would be to only update the timestamp in memory (so that
it would appear updated on D-Bus), but delay writing the file until
something important happens. `nm_key_file_db_*()` already tracks whether
there are changes ("dirty") and whether it's necessary to write the
file. It would be possible to track two dirty flags: one that requires
immediate update, and one that only ensures we will re-write dirty files
eventually.

See-also: https://bugzilla.gnome.org/show_bug.cgi?id=583756

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1171
2022-04-01 19:36:14 +02:00
Beniamino Galvani
586afdfc52 wwan: re-enable IPv6 once the modem returns a IPv6 configuration
IPv6 gets disabled at the beginning of the activation in
ip_ifindex_changed_cb(). Enable it again when the modem returns a IPv6
configuration.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/944
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1170
2022-04-01 09:13:57 +02:00
Fernando Fernandez Mancera
2bbe7f9204 ovs, dpdk: ignore ovs-netdev tun interface
When configuring a OVS bridge to use the netdev datapath, OpenvSwitch
will create a tun interface named ovs-netdev. This interface should be
ignored by NetworkManager.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1169
2022-03-31 11:49:34 +02:00
Beniamino Galvani
580ef03bee core: export radio flags
Introduce a RadioFlags property on the manager object. For now it
contains two bits WLAN_AVAILABLE, WWAN_AVAILABLE to indicate whether
any radio interface is present in the system. The presence of a radio
is detected by looking at devices and rfkill switches.

In future, any radio-related read-only boolean flag can be exposed via
this property, including the already existing WirelessHardwareEnabled
and WwanHardwareEnabled properties.
2022-03-29 09:34:07 +02:00
Beniamino Galvani
2343148da8 core: introduce "unavailable" rfkill state
Introduce a new "unavailable" rfkill state to indicate that no rfkill
hardware was found. Currently it is still handled as "unblocked".
2022-03-29 09:12:36 +02:00
Lubomir Rintel
82d16789a5 settings-connection: add a "plugin" argument to Update2()
This will allow migrating a connection. If specified, the connection will
be confined to a particular settings plugin when written back. If the
plugin differs from the existing one, it will be removed from the old one.
2022-03-28 13:29:28 +02:00
Lubomir Rintel
f4f165f945 settings: add "plugin" argument to AddAndActivate2()
This will confine a newly added connection to a particular settings
plugin.
2022-03-28 13:29:28 +02:00
Christian Eggers
f6ec6ef364
core: create GMainLoop after daemonizing
The GMainLoop instance (and the default GMainContext singleton) is not
required for trivial operations like --print-config, --version or
--help). If running as SysV daemon, the event file descriptor is
unnecessarily dup'ed from the parent to the child process.

Signed-off-by: Christian Eggers <ceggers@arri.de>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1160
2022-03-22 13:43:41 +01:00
Thomas Haller
0614017ac6
dnsmasq/shared: drop "--dhcp-lease-max=50" option
It's not clear why this option is set or why it's necessary. It was
set ever since.

Note that we automatically determines the DHCP range
nm_dnsmasq_utils_get_range(), and with /24 subnets (or larger)
the range spans up to 244 addresses.

With such a DHCP range it doesn't seem to make sense to limit the
number of leases to 50. It also doesn't seem to make sense to limit it
at all. Drop this.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/941

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1156
2022-03-21 17:14:17 +01:00
Thomas Haller
6b191d6ea7
dhcp: simplify nm_dhcp_client_set_effective_client_id()
The "take" parameter of _set_effective_client_id() was always "FALSE". Drop it.
Also, drop _set_effective_client_id() and just call nm_dhcp_client_set_effective_client_id()
directly.
2022-03-21 13:09:28 +01:00
Thomas Haller
874403b588
dhcp: use nm_g_bytes_equal0() in _set_effective_client_id() 2022-03-21 13:04:52 +01:00
Beniamino Galvani
9ac143d2d5 dhcp: fix memory leak
Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2022-03-20 17:30:39 +01:00
Thomas Haller
b3192d2d46
device: allow reapply for changed "connection.autoconnect-slaves" property
We list the properties that can be reapplied, and reject the reapply
operation for any other changes. The idea is that usually reapply
of a property requires an explicit implementation (or may not make
sense).

"connection.autoconnect-slaves" is something that takes effect when
activating the master device. It does not matter when the device
is already active, thus there is no need to reject the reapply
operation.

https://bugzilla.redhat.com/show_bug.cgi?id=2065049

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1150
2022-03-18 15:36:43 +01:00
Thomas Haller
14b9a9bd9d
connectivity: fix constructing hosts list for CURLOPT_RESOLVE
Curl's CURLOPT_RESOLVE expects one list entry per host. That
documentation ([1]) also makes that clear that the form is
"[+]HOST:PORT:ADDRESS[,ADDRESS]".

The way we constructed the list, only the last entry was honored:

  <trace> [1647551393.5362] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:18.159.254.57' to curl resolve list
  <trace> [1647551393.5363] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:152.19.134.142' to curl resolve list
  <trace> [1647551393.5363] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:18.192.40.85' to curl resolve list
  ...
  <trace> [1647551393.5366] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:85.236.55.6' to curl resolve list
  <trace> [1647551393.5366] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:38.145.60.20' to curl resolve list
  ...
  <trace> [1647551393.5415] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:18.159.254.57 to DNS cache\012
  <trace> [1647551393.5416] connectivity: (eth0,IPv4,25) libcurl: == Info: RESOLVE fedoraproject.org:80 is - old addresses discarded!\012
  <trace> [1647551393.5416] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:152.19.134.142 to DNS cache\012
  <trace> [1647551393.5417] connectivity: (eth0,IPv4,25) libcurl: == Info: RESOLVE fedoraproject.org:80 is - old addresses discarded!\012
  ...
  <trace> [1647551393.5422] connectivity: (eth0,IPv4,25) libcurl: == Info: RESOLVE fedoraproject.org:80 is - old addresses discarded!\012
  <trace> [1647551393.5423] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:38.145.60.20 to DNS cache\012
  <trace> [1647551393.5424] connectivity: (eth0,IPv4,25) libcurl: == Info: Hostname fedoraproject.org was found in DNS cache\012
  <trace> [1647551393.5424] connectivity: (eth0,IPv4,25) libcurl: == Info:   Trying 38.145.60.20:80...\012

There are two possible fixes. Either join all addresses in one
entry, or use the '+' modifier. Do the former.

Now we get:

  <trace> [1647551967.0378] connectivity: (eth0,IPv4,25) set curl resolve list to 'fedoraproject.org:80:38.145.60.21,152.19.134.142,152...
  ...
  <trace> [1647551967.0559] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:38.145.60.21,152.19.134.142,152.1...
  <trace> [1647551967.0560] connectivity: (eth0,IPv4,25) libcurl: == Info: Hostname fedoraproject.org was found in DNS cache\012
  <trace> [1647551967.0561] connectivity: (eth0,IPv4,25) libcurl: == Info:   Trying 38.145.60.21:80...\012

[1] https://curl.se/libcurl/c/CURLOPT_RESOLVE.html

Reported-by: Bastien Nocera <hadess@hadess.net>

Fixes: 2cec94bacc ('connectivity: use systemd-resolved for resolving the check endpoint')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/648#note_1301596

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1153
2022-03-18 15:02:42 +01:00
Bastien Nocera
4e6b18e595 connectivity: Add debug to curl queries
Add debug output when we use curl to make queries.

References: https://curl.se/libcurl/c/debug.html
2022-03-17 20:41:31 +00:00
Thomas Haller
18d0ab14bc
device: drop unused variable and avoid compiler warning
../src/core/devices/nm-device-ethernet.c:1164:35: error: unused variable error [-Werror,-Wunused-variable]
              gs_free_error GError *error    = NULL;
                                    ^

Fixes: aa9b5e28eb ('ethernet: fix setting ip-ifindex for PPPoE connections')
2022-03-17 19:31:29 +01:00
Lubomir Rintel
feee84aac4 wifi: mark WEP connections incompatible if supplicant lacks capability
This allows us to reject activation of WEP profiles very early,
also providing a reasonable error code to the client:

  $ nmcli d wifi connect test
  Error: Failed to add/activate new connection: wpa_supplicant does not support WEP encryption
2022-03-17 12:44:53 +01:00
Lubomir Rintel
41d03a1b17 supplicant: check whether WEP is available
Since version 2.10, it's possible to build wpa_supplicant without WEP
support. In fact, it's disabled by default. Regrettably, there's no
indication in that version as to whether WEP is enabled or not.

A patch has been sent upstream that exposes the information on D-Bus:
https://patchwork.ozlabs.org/project/hostap/patch/20220307085446.706024-1-lkundrak@v3.sk/

This makes use of the above to indicate presence or absence of WEP
support.
2022-03-17 12:44:53 +01:00
Lubomir Rintel
91f076d235 supplicant: add a comment about extending NMSupplCapType
We've failed to amend logging in relevant places twice. Let's add a
hopefully helpful remark.
2022-03-17 12:44:53 +01:00
Lubomir Rintel
78c937cb23 supplicant: log WPA-EAP-SUITE-B-192 capability
Fixes: e874ccc917 ('wifi: add WPA-EAP-SUITE-B-192 support')
2022-03-17 12:44:53 +01:00
Thomas Haller
ca9c67565a
connectivity: use GSource instead of source id for tracking timeout/idle source
I think we should move away from using the source-ids.

Having a "GSource*" pointer makes it clearer what this is, compared to a
guint source ID. Also, g_source_remove() always needs to first do a hash
lookup (with locking) to resolve the source ID to the GSource. This is
unnecessary.
2022-03-17 10:27:33 +01:00