Commit Graph

30304 Commits

Author SHA1 Message Date
Thomas Haller
40f22e69c8 platform: fix undefined behavior for pointer comparison in ip4_addr_subnets_is_plain_address()
Fixes: 2f68a50041 ('platform: fix the order of addition of primary and secondary IPv4 addresses')
2022-04-08 15:54:12 +02:00
Thomas Haller
cedaa191d4 platform: fix returning error from nm_platform_ip_address_sync()
None of the callers really handle the return value of nm_platform_ip_address_sync()
or whether the function encountered problems. What would they anyway do
about that?

For IPv4 we were already ignoring errors to add addresses, but for IPv6 we
aborted. That seems wrong. As the caller does not really handle errors,
I think we should follow through and add all addresses in case of error.

Still, also collect a overall "success" of the function and return it.
2022-04-08 15:54:12 +02:00
Thomas Haller
80f8e23992 platform: fix address order in nm_platform_ip_address_sync()
In the past, nm_platform_ip_address_sync() only had the @known_addresses
argument. We would figure out which addresses to delete and which to preserve,
based on what addresses were known. That means, @known_addresses must have contained
all the addresses we wanted to preserve, even the external ones. That approach
was inherently racy.

Instead, nowadays we have the addresses we want to configure (@known_addresses)
and the addresses we want to delete (@prune_addresses). This started to change in
commit dadfc3abd5 ('platform: allow injecting the list of addresses to prune'),
but only commit 58287cbcc0 ('core: rework IP configuration in NetworkManager using
layer 3 configuration') actually changed to pass separate @prune_addresses argument.

However, the order of IP addresses matters and there is no sensible kernel API
to configure the order (short of adding them in the right order), we still need
to look at all the addresses, check their order, and possibly delete some.
That is, we need to handle addresses we want to delete (@prune_addresses)
but still look at all addresses in platform (@plat_addresses) to check
their order.

Now, first handle @prune_addresses. That's simple. These are just the
addresses we want to delete. Second, get the list of all addresses in
platform (@plat_addresses) and check the order.

Note that if there is an external address that interferes with our
desired order, we will leave it untouched. Thus, such external addresses
might prevent us from getting the order as desired. But that's just
how it is. Don't add addresses outside of NetworkManager to avoid that.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2022-04-08 15:54:12 +02:00
Thomas Haller
a60a262574 platform: add nm_platform_ip_address_delete() helper 2022-04-08 15:54:12 +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
1234e5583a build/autotools: avoid compiler warning generating "NM-1.0.gir"
We passed on the CFLAGS, but they also contain

  "-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40"

which causes compiler warnings:

    GISCAN   src/libnm-client-impl/NM-1.0.gir
  /data/src/NetworkManager/tmp-introspect_17ddrdb/NM-1.0.c: In function ‘dump_object_type’:
  /data/src/NetworkManager/tmp-introspect_17ddrdb/NM-1.0.c:251:13: warning: Not available before 2.70
    251 |   if (G_TYPE_IS_FINAL (type))
        |             ^~~~~~~~~~~~~~~~~
  /data/src/NetworkManager/tmp-introspect_17ddrdb/NM-1.0.c: In function ‘dump_fundamental_type’:
  /data/src/NetworkManager/tmp-introspect_17ddrdb/NM-1.0.c:369:13: warning: Not available before 2.70
    369 |   if (G_TYPE_IS_FINAL (type))
        |             ^~~~~~~~~~~~~~~~~

Filter them out.

See-also: https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/331
2022-04-07 11:55:34 +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
7003b5eb70 contrib: don't abort on first error during ftpadmin install
With "rc1" mode, we install more than one tarballs (the one for 1.37.90
and 1.39.0). If we reach this point, we already pushed the git tags.
There is no way back.

Ignore errors at first and try to release all tarballs. Only signal the error
at the end.
2022-04-06 19:17:58 +02:00
Thomas Haller
5b6311ea07 release: bump version to 1.39.0 (development) 2022-04-06 18:51:55 +02:00
Thomas Haller
35f27f4511 release: bump version to 1.37.90 (1.38-rc1) 2022-04-06 18:39:01 +02:00
Thomas Haller
8e76b08e1c NEWS: update 2022-04-06 18:28:06 +02:00
Thomas Haller
1d7bea8cf6 NEWS: update 2022-04-06 16:02:10 +02:00
Thomas Haller
8df79f60d6 libnm: merge branch 'th/libnm-8021x-empty-strings'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/973

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1180
2022-04-06 13:48:24 +02:00
Thomas Haller
915e923928 libnm: normalize empty strings in 802-1x setting
Supplicant does not allow setting certain properties to empty values.
It also does not make sense.

Also, ifcfg-rh writer uses svSetValueStr() for these properties, so
the ifcfg plugin would always loose having hte values set to "".

Also, you couldn't enter these strings in nmcli.

It's fair to assume that it makes no sense to have these values set to
an empty value. Since we cannot just tighten up verification to reject
them, normalize them.

It also seems that some GUI now starts setting domain_suffix_match to an
empty string. Or maybe it was always doing it, and ifcfg plugin just hid
the problem? Anyway, we have users out there who set these properties to
"".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/973
2022-04-06 13:48:04 +02:00
Thomas Haller
445e783771 libnm: fix printing NULL value in NMSetting8021x.verify() 2022-04-06 13:47:21 +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
Thomas Haller
e9340c792c contrib: fail "find-backports" script if we have no "refs/notes/bugs" notes
"find-backports" script parses the commit messages to figure out which
patches to backport. We use "refs/notes/bugs" notes to extend the
meta data after the commit was merged. If you don't setup the
notes, the output is likely incomplete or wrong.

Yes, this is annoying. It requires you to setup the notes as described
in "CONTRIBUTING.md". Also because the "release.sh" script runs "find-backports",
so that means you cannot do releases without setting up the notes
(unless you manually disable running "find-backports"). But you really shouldn't
make a release based on incomplete information.
2022-04-06 13:23:37 +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
a4da2eb5e5 contrib: improve detection of fedpkg repository in "makerepo.sh" 2022-04-06 09:46:14 +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
f3be419719 contrib: better autotect python files to format for "nm-python-black-format.sh" script 2022-04-05 09:45:20 +02:00
Thomas Haller
4e28bd5a94 find-backports: support "Ignore-Fixes:" tag to ignore "Fixes:" commit
"Ignore-Backport:" is already in use. For the find-backports script it
has the same meaning as a "cherry picked from" line, that means, we
assume that the referenced patch was backported already and the fix
applied.

This is of course useful to make the script shut up about backports that
we don't want to do. However, it requires us to tag the old branch
with this, so that the script thinks that the patch is already there.

Imaging we have a wrong commit on "next" branch with a Fixes line. We
don't want to backport it, so we would have to tag the "old" branch with
"Ignore-Backport:". That is cumbersome.

Instead, now also support that if a commit contains a "Fixes:" line any
an "Ignore-Fixes:" for the same fixed commit, then this let's the
"Fixes:" line be ignored.
2022-04-05 09:18:22 +02:00
Thomas Haller
4a35dbe6a7 systemd: describe import of systemd code in README.md 2022-04-04 21:33:06 +02:00
Thomas Haller
7b3466fc4c systemd: update code from upstream (2022-04-01)
This is a direct dump from systemd git.

  $ git clean -fdx && \
    git cat-file -p HEAD | sed '1,/^======$/ d' | bash - && \
    git add .

======

SYSTEMD_DIR=../systemd
COMMIT=64c843d12dde2a7dc2646a09f38d697caa7faee3

(
  cd "$SYSTEMD_DIR"
  git checkout "$COMMIT"
  git reset --hard
  git clean -fdx
)

git ls-files -z :/src/libnm-systemd-core/src/ \
                :/src/libnm-systemd-shared/src/ \
                :/src/libnm-std-aux/unaligned.h | \
  xargs -0 rm -f

nm_copy_sd_shared() {
    mkdir -p "./src/libnm-systemd-shared/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-shared/$1"
}

nm_copy_sd_core() {
    mkdir -p "./src/libnm-systemd-core/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-systemd-core/$1"
}

nm_copy_sd_stdaux() {
    mkdir -p "./src/libnm-std-aux/"
    cp "$SYSTEMD_DIR/$1" "./src/libnm-std-aux/${1##*/}"
}

nm_copy_sd_core "src/libsystemd-network/arp-util.c"
nm_copy_sd_core "src/libsystemd-network/arp-util.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-lease-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp-network.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-option.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-packet.c"
nm_copy_sd_core "src/libsystemd-network/dhcp-protocol.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-option.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.c"
nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h"
nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.c"
nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.h"
nm_copy_sd_core "src/libsystemd-network/lldp-network.c"
nm_copy_sd_core "src/libsystemd-network/lldp-network.h"
nm_copy_sd_core "src/libsystemd-network/lldp-rx-internal.h"
nm_copy_sd_core "src/libsystemd-network/network-common.c"
nm_copy_sd_core "src/libsystemd-network/network-common.h"
nm_copy_sd_core "src/libsystemd-network/network-internal.c"
nm_copy_sd_core "src/libsystemd-network/network-internal.h"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp-client.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp-lease.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd_core "src/libsystemd-network/sd-ipv4ll.c"
nm_copy_sd_core "src/libsystemd-network/sd-lldp-rx.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-source.h"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.c"
nm_copy_sd_core "src/libsystemd/sd-event/event-util.h"
nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c"
nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h"
nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c"
nm_copy_sd_core "src/systemd/_sd-common.h"
nm_copy_sd_core "src/systemd/sd-dhcp-client.h"
nm_copy_sd_core "src/systemd/sd-dhcp-lease.h"
nm_copy_sd_core "src/systemd/sd-dhcp-option.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-client.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd_core "src/systemd/sd-dhcp6-option.h"
nm_copy_sd_core "src/systemd/sd-event.h"
nm_copy_sd_core "src/systemd/sd-id128.h"
nm_copy_sd_core "src/systemd/sd-ipv4acd.h"
nm_copy_sd_core "src/systemd/sd-ipv4ll.h"
nm_copy_sd_core "src/systemd/sd-lldp-rx.h"
nm_copy_sd_core "src/systemd/sd-lldp.h"
nm_copy_sd_core "src/systemd/sd-ndisc.h"
nm_copy_sd_shared "src/basic/alloc-util.c"
nm_copy_sd_shared "src/basic/alloc-util.h"
nm_copy_sd_shared "src/basic/async.h"
nm_copy_sd_shared "src/basic/cgroup-util.h"
nm_copy_sd_shared "src/basic/dns-def.h"
nm_copy_sd_shared "src/basic/env-file.c"
nm_copy_sd_shared "src/basic/env-file.h"
nm_copy_sd_shared "src/basic/env-util.c"
nm_copy_sd_shared "src/basic/env-util.h"
nm_copy_sd_shared "src/basic/errno-util.h"
nm_copy_sd_shared "src/basic/escape.c"
nm_copy_sd_shared "src/basic/escape.h"
nm_copy_sd_shared "src/basic/ether-addr-util.c"
nm_copy_sd_shared "src/basic/ether-addr-util.h"
nm_copy_sd_shared "src/basic/extract-word.c"
nm_copy_sd_shared "src/basic/extract-word.h"
nm_copy_sd_shared "src/basic/fd-util.c"
nm_copy_sd_shared "src/basic/fd-util.h"
nm_copy_sd_shared "src/basic/fileio.c"
nm_copy_sd_shared "src/basic/fileio.h"
nm_copy_sd_shared "src/basic/format-util.c"
nm_copy_sd_shared "src/basic/format-util.h"
nm_copy_sd_shared "src/basic/fs-util.c"
nm_copy_sd_shared "src/basic/fs-util.h"
nm_copy_sd_shared "src/basic/hash-funcs.c"
nm_copy_sd_shared "src/basic/hash-funcs.h"
nm_copy_sd_shared "src/basic/hashmap.c"
nm_copy_sd_shared "src/basic/hashmap.h"
nm_copy_sd_shared "src/basic/hexdecoct.c"
nm_copy_sd_shared "src/basic/hexdecoct.h"
nm_copy_sd_shared "src/basic/hostname-util.c"
nm_copy_sd_shared "src/basic/hostname-util.h"
nm_copy_sd_shared "src/basic/in-addr-util.c"
nm_copy_sd_shared "src/basic/in-addr-util.h"
nm_copy_sd_shared "src/basic/inotify-util.c"
nm_copy_sd_shared "src/basic/inotify-util.h"
nm_copy_sd_shared "src/basic/io-util.c"
nm_copy_sd_shared "src/basic/io-util.h"
nm_copy_sd_shared "src/basic/list.h"
nm_copy_sd_shared "src/basic/log.h"
nm_copy_sd_shared "src/basic/macro.h"
nm_copy_sd_shared "src/basic/memory-util.c"
nm_copy_sd_shared "src/basic/memory-util.h"
nm_copy_sd_shared "src/basic/mempool.c"
nm_copy_sd_shared "src/basic/mempool.h"
nm_copy_sd_shared "src/basic/missing_fcntl.h"
nm_copy_sd_shared "src/basic/missing_random.h"
nm_copy_sd_shared "src/basic/missing_socket.h"
nm_copy_sd_shared "src/basic/missing_stat.h"
nm_copy_sd_shared "src/basic/missing_syscall.h"
nm_copy_sd_shared "src/basic/missing_type.h"
nm_copy_sd_shared "src/basic/ordered-set.c"
nm_copy_sd_shared "src/basic/ordered-set.h"
nm_copy_sd_shared "src/basic/parse-util.c"
nm_copy_sd_shared "src/basic/parse-util.h"
nm_copy_sd_shared "src/basic/path-util.c"
nm_copy_sd_shared "src/basic/path-util.h"
nm_copy_sd_shared "src/basic/prioq.c"
nm_copy_sd_shared "src/basic/prioq.h"
nm_copy_sd_shared "src/basic/process-util.c"
nm_copy_sd_shared "src/basic/process-util.h"
nm_copy_sd_shared "src/basic/random-util.c"
nm_copy_sd_shared "src/basic/random-util.h"
nm_copy_sd_shared "src/basic/ratelimit.c"
nm_copy_sd_shared "src/basic/ratelimit.h"
nm_copy_sd_shared "src/basic/set.h"
nm_copy_sd_shared "src/basic/signal-util.c"
nm_copy_sd_shared "src/basic/signal-util.h"
nm_copy_sd_shared "src/basic/siphash24.h"
nm_copy_sd_shared "src/basic/socket-util.c"
nm_copy_sd_shared "src/basic/socket-util.h"
nm_copy_sd_shared "src/basic/sort-util.h"
nm_copy_sd_shared "src/basic/sparse-endian.h"
nm_copy_sd_shared "src/basic/stat-util.c"
nm_copy_sd_shared "src/basic/stat-util.h"
nm_copy_sd_shared "src/basic/stdio-util.h"
nm_copy_sd_shared "src/basic/string-table.c"
nm_copy_sd_shared "src/basic/string-table.h"
nm_copy_sd_shared "src/basic/string-util.c"
nm_copy_sd_shared "src/basic/string-util.h"
nm_copy_sd_shared "src/basic/strv.c"
nm_copy_sd_shared "src/basic/strv.h"
nm_copy_sd_shared "src/basic/strxcpyx.c"
nm_copy_sd_shared "src/basic/strxcpyx.h"
nm_copy_sd_shared "src/basic/time-util.c"
nm_copy_sd_shared "src/basic/time-util.h"
nm_copy_sd_shared "src/basic/tmpfile-util.c"
nm_copy_sd_shared "src/basic/tmpfile-util.h"
nm_copy_sd_shared "src/basic/umask-util.h"
nm_copy_sd_shared "src/basic/user-util.h"
nm_copy_sd_shared "src/basic/utf8.c"
nm_copy_sd_shared "src/basic/utf8.h"
nm_copy_sd_shared "src/basic/util.c"
nm_copy_sd_shared "src/basic/util.h"
nm_copy_sd_shared "src/fundamental/macro-fundamental.h"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.c"
nm_copy_sd_shared "src/fundamental/string-util-fundamental.h"
nm_copy_sd_shared "src/fundamental/types-fundamental.h"
nm_copy_sd_shared "src/shared/dns-domain.c"
nm_copy_sd_shared "src/shared/dns-domain.h"
nm_copy_sd_shared "src/shared/log-link.h"
nm_copy_sd_shared "src/shared/web-util.c"
nm_copy_sd_shared "src/shared/web-util.h"
nm_copy_sd_stdaux "src/basic/unaligned.h"
2022-04-04 19:37:38 +02:00
Thomas Haller
721f0e75de connectivity: merge branch 'th/connectivity-resolve'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1176
2022-04-04 16:10:22 +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
Yuri Chornoivan
2e2877b5e3 po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1177
2022-04-04 15:17:27 +02:00
Beniamino Galvani
ca9a6c471f wifi: merge branch 'bg/wpa3-transition'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1175
2022-04-04 11:13:56 +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
Thomas Haller
d1dfcc4c9d platform,device: merge branch 'replace-sysfs-with-netlink'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1127
2022-04-02 22:40:39 +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
e4ad8f8a9b platform: Add change link functions to nm-platform
Since updating options of bridge is now done with netlink we need
support function for that in nm-platform.
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
Thomas Haller
a640d0b7ba build: merge branch 'th/python-black'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1174
2022-04-01 19:10:04 +02:00
Thomas Haller
bb605eabc6 gitlab-ci: use "nm-python-black-format.sh" script on "check-tree" 2022-04-01 14:02:23 +02:00
Thomas Haller
12299ee91e build: drop "check-python-black" check from autotools
Previously, autotools would detect whether we have "black"
in the path. And if so, it would check formatting during `make check`.

That's problematic. When I run `./contrib/fedora/rpm/build_clean.sh -w test`
in certain cases, it would pick up black, but then fail with

  Traceback (most recent call last):
    File "/usr/bin/black", line 5, in <module>
      from black import patched_main
    File "/usr/lib/python3.6/site-packages/black.py", line 42, in <module>
      from attr import dataclass, evolve, Factory
  ModuleNotFoundError: No module named 'attr'
  make[3]: *** [Makefile:21658: check-python-black] Error 1

That's an installation error of black, but still, during package build
there is no need to check the formatting. We could export
`NMTST_SKIP_PYTHON_BLACK=1` to prevent it, but it's still unnecessary.

We check proper formatting in gitlab-ci. That is enough, it doesn't
need to run during `make check`. In particular, because `black .`
takes 1.5 seconds on my machine.
2022-04-01 14:01:45 +02:00
Thomas Haller
49b0a92b5a contrib: add "nm-python-black-format.sh" script
This is more for completeness, to go along "nm-code-format.sh"
script.

Usually it's very simple to run black directly (you may still do that).
However, black by default only reformats files with ".py" extension.
So to get all our python files, you'd need to know and explicitly
select them... or use this script.

Also, `black .` scans the entire source tree, and is rather slow.
This script knows which files to select and is thus faster.
2022-04-01 14:00:30 +02:00
Thomas Haller
670894b667 contrib: fix wrong usage text for "nm-code-format.sh" 2022-04-01 13:51:56 +02:00
muzena
5d440610a9 po: update Croatian (hr) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1172
2022-04-01 12:25:30 +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