Commit graph

27833 commits

Author SHA1 Message Date
Thomas Haller 9bba4871f3
build: move "libnm/" to "src/" and split it
Like with "libnm-core/", split "libnm/" into different directories for
the public headers, for the implementation and for the helper "aux"
library.
2021-02-24 12:48:37 +01:00
Thomas Haller b53c50e778
shared: move "nm-test-utils.h" to "src/libnm-glib-aux/"
"nm-test-utils.h" is a header-only, helper library for our unit tests.
It was somewhat unmotivated in "shared/nm-utils", because all tests use
it, but it was not part of a "module".

Move it to "src/libnm-glib-aux/". It fits there very well. They both
have (only) a dependency on glib.
2021-02-24 12:48:33 +01:00
Thomas Haller 3906cc9cf4
build: move c-util/nettools library from "shared/" to "src/" 2021-02-24 12:48:28 +01:00
Thomas Haller a8c34b9dcf
build: move "shared/nm-std-aux" to "src/libnm-std-aux" 2021-02-24 12:48:24 +01:00
Thomas Haller 9dc84b32b0
build: move "shared/nm-{glib-aux,log-null,log-core}" to "src/libnm-{glib-aux,log-null,log-core}" 2021-02-24 12:48:20 +01:00
Thomas Haller 4d12a6ac3d
build: move "shared/nm-{base,udev-aux}" to "src/libnm-{base,udev-aux}" 2021-02-24 12:48:19 +01:00
Thomas Haller 174bd45344
build/meson: include meson.build for tests at the end
We want that there is a clear hierarchy and dependency between
modules/directories.

But tests sometimes break that.

For example, "shared/nm-glib-aux/tests" link against libnm-glib-aux
and libnm-log-null. But "shared/nm-log-null" depends on "shared/nm-glib-aux".
Hence, for the test there is a circular dependency.

Break that, by including all tests at the end.

The alternative would be ugly in different ways.
2021-02-24 12:48:18 +01:00
Thomas Haller 2439374457
build: move "shared/nm-platform" to "src/libnm-platform" 2021-02-24 12:48:17 +01:00
Thomas Haller 39225258d6
build: move "shared/systemd" to "src/libnm-systemd-shared" 2021-02-24 12:48:16 +01:00
Thomas Haller b55710d6a6
shared: rename "libnm-systemd-logging-stub.la" to "libnm-log-null.la"
This is really just a different implementation of
"nm-glib-aux/nm-logging-fwd.h", that parallels libnm-log-core.

It's also not only useful to shared/systemd, but also share/nm-platform,
which also requires linking with a logging backend.
2021-02-24 12:48:16 +01:00
Thomas Haller 074c83d483
build/autotools: fix dependencies against mkenum header for building examples 2021-02-24 12:48:15 +01:00
Thomas Haller a0c3396335
build: add missing dependencies for "libnm/nm-enum-types.h"" 2021-02-24 12:48:15 +01:00
Yuri Chornoivan 9a928cfc60
po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/761
2021-02-24 09:14:03 +01:00
Wen Liang 6b50d52ed0
docs: improve manual page about ipv4.routes
Signed-off-by: Wen Liang <liangwen12year@gmail.com>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/757
2021-02-23 22:04:16 +01:00
Thomas Haller 9e7af31454
bond: avoid logging warning to set "ad_actor_system=00:00:00:00:00:00"
The bond option ad_actor_system only matters (and is available) with
mode=802.3ad.

When you create a new bond, the sysctl value will be set to "00:00:00:00:00:00".
So this seems to be a valid value, and in fact the default value for
this option. However, kernel will fail with EINVAL to set the sysctl to
"00:00:00:00:00:00". Kernel fails both if the value is already
"00:00:00:00:00:00" (i.e. setting the same value results in an error) and
it also fails otherwise (i.e. we cannot ever reset the value to
"00:00:00:00:00:00", at least not via sysfs).

Avoid the warning in the common case, where the value is already as
expected.

Otherwise, we still get the warning and won't be able to set the right
value. But this is really a limitation of the kernel API where we cannot
do anything about it (in NetworkManager).

https://bugzilla.redhat.com/show_bug.cgi?id=1923999
2021-02-23 14:18:02 +01:00
Beniamino Galvani 09c943b9a7 supplicant: merge branch 'bg/issue638-wpa2-sae'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/638
2021-02-23 10:24:55 +01:00
Beniamino Galvani f5d78c2d28 supplicant: enable WPA3 for WPA-PSK connections
A connection with key-mgmt=wpa-psk should be able to connect to WPA,
WPA2 and WPA3 APs, choosing the best candidate automatically.

Also pass SAE (WPA3) key-mgmt to wpa_supplicant when it is supported.

For example, I now get this when connecting to a WPA2 network:
<info>  [1613749711.2915] Config: added 'key_mgmt' value 'WPA-PSK WPA-PSK-SHA256 FT-PSK SAE FT-SAE'
2021-02-23 10:24:18 +01:00
Beniamino Galvani d233314ce1 supplicant: print interface capabilities 2021-02-23 10:22:09 +01:00
Beniamino Galvani f7f4db156f supplicant: detect the SAE interface capability
There isn't a global SAE capability in wpa_supplicant, use the
per-interface one.
2021-02-23 10:22:09 +01:00
Thomas Haller 5747bdb8b8
wwan: fix leaking "bearer" in connect_ready()
Fixes: 105ee6e5a9 ('device: fix crash by handling connection cancellation')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/669
2021-02-23 07:23:41 +01:00
Thomas Haller e3a7f29e2a
iwd: make static variable in object_compare_interfaces() "const" 2021-02-22 13:15:58 +01:00
Jan Palus 2e0752b1bf
iwd: terminate interface_order array with NULL
fixes segfault with iwd backend after upgrade to NetworkManager 1.30.0

Signed-off-by: Jan Palus <jpalus@fastmail.com>

Fixes: 43fd93d8f4 ('iwd: Order objects from g_dbus_object_manager_get_objects')
2021-02-22 13:11:16 +01:00
Thomas Haller 1e81827e6f
platform/tests: relax unit test for setting IFLA_BR_FORWARD_DELAY/forward_delay
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/665

Fixes: e9278d8659 ('platform/tests: ignore failure for adding bridge with iproute2')
2021-02-21 20:08:13 +01:00
Beniamino Galvani 933e6c140e wifi: merge branch 'georgmu/NetworkManager-ap-disable-wps'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/756
2021-02-19 15:26:57 +01:00
Georg Müller ba8c61fe9a supplicant: disable wps in wpa supplicant if disabled in config
Before this commit, in AP mode, WPS is started by default and there is no
possibility to disable it. The methods provided as WPS sources seem to
differ from device to device. With some Wifi USB sticks running in AP mode,
the WPS config methods contain "Keypad". Then, I get a pin entry dialog on
Windows machines, even if no pin is configured.

This merge request wires the existing 802-11-wireless-security.wps-method
with wpa_supplicant's configuration to allow disabling WPS.
2021-02-19 14:34:19 +01:00
Thomas Haller 124e085376
libnm/build: merge branch 'th/libnm-core-split'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/755
2021-02-19 09:57:15 +01:00
Thomas Haller 341b6e0704
all: change G_LOG_DOMAIN to "nm"
glib requires G_LOG_DOMAIN defined so that log messages are labeled
to belong to NetworkManager or libnm.

However, we don't actually want to use glib logging. Our library libnm
MUST not log anything, because it spams the user's stdout/stderr.
Instead, a library must report notable events via its API. Note that
there is also LIBNM_CLIENT_DEBUG to explicitly enable debug logging,
but that doesn't use glib logging either.

Also, the daemon does not use glib logging instead it logs to syslog.
When run with `--debug`.

Hence, it's not useful for us to define different G_LOG_DOMAIN per
library/application, because none of our libraries/applications should
use glib logging.

It also gets slightly confusing, because we have the static library like
`src/libnm-core-impl`, which is both linked into `libnm` (the library)
and `NetworkManager` (the daemon). Which logging domain should they use?

Set the G_LOG_DOMAIN to "nm" everywhere. But no longer do it via `-D`
arguments to the compiler.

See-also: https://developer.gnome.org/glib/stable/glib-Message-Logging.html#G-LOG-DOMAIN:CAPS
2021-02-18 19:46:57 +01:00
Thomas Haller 243051a8a6
libnm/build: always compile both crypto backends if library available
We want to see that both backends can actually compile -- at least,
if we have the dependencies detected.
2021-02-18 19:46:54 +01:00
Thomas Haller fdf9614ba7
build: move "libnm-core/" to "src/" and split it
"libnm-core/" is rather complicated. It provides a static library that
is linked into libnm.so and NetworkManager. It also contains public
headers (like "nm-setting.h") which are part of public libnm API.

Then we have helper libraries ("libnm-core/nm-libnm-core-*/") which
only rely on public API of libnm-core, but are themself static
libraries that can be used by anybody who uses libnm-core. And
"libnm-core/nm-libnm-core-intern" is used by libnm-core itself.

Move "libnm-core/" to "src/". But also split it in different
directories so that they have a clearer purpose.

The goal is to have a flat directory hierarchy. The "src/libnm-core*/"
directories correspond to the different modules (static libraries and set
of headers that we have). We have different kinds of such modules because
of how we combine various code together. The directory layout now reflects
this.
2021-02-18 19:46:51 +01:00
Thomas Haller 2c1f8e9108
release: bump version to 1.31.1 (development) 2021-02-18 18:23:42 +01:00
Thomas Haller 1a1606186c
NEWS: update 2021-02-18 18:21:24 +01:00
Thomas Haller fc29a96097
release: bump version to 1.30.0 2021-02-18 18:09:31 +01:00
Thomas Haller 04290879b7
release: fix pattern in release.sh script for checking branch name 2021-02-18 17:53:15 +01:00
Thomas Haller 9e16c4cc94
platform/tests: relax check for signals in test_ip6_route()
/route/ip6: NMPlatformSignalAssert: ../src/core/platform/tests/test-route.c:449, test_ip6_route(): failure to accept signal one time: 'ip6-route-changed-added' ifindex 0 (2 times received)

(cherry picked from commit 39c3eacb7d)
2021-02-18 17:47:13 +01:00
Thomas Haller 39c3eacb7d
platform/tests: relax check for signals in test_ip6_route()
/route/ip6: NMPlatformSignalAssert: ../src/core/platform/tests/test-route.c:449, test_ip6_route(): failure to accept signal one time: 'ip6-route-changed-added' ifindex 0 (2 times received)
2021-02-18 17:40:27 +01:00
Thomas Haller a592617717
NEWS: update 2021-02-18 17:20:30 +01:00
Thomas Haller c5916691c9
NEWS: update 2021-02-18 07:31:55 +01:00
Wen Liang 6b78406460
docs: improve manual page about ipv4.addresses
Signed-off-by: Wen Liang <liangwen12year@gmail.com>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/738
2021-02-17 17:55:56 +01:00
Thomas Haller b9bdc680ad
build: dist "libnm/nm-enum-types.[ch].template" files
(cherry picked from commit b941686b5a)
2021-02-17 14:24:54 +01:00
Thomas Haller b941686b5a
build: dist "libnm/nm-enum-types.[ch].template" files 2021-02-17 14:24:11 +01:00
Beniamino Galvani 12261f8002 initrd: merge branch 'bg/initrd-timeout'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/559

(cherry picked from commit 2b3acd1045)
2021-02-17 11:29:26 +01:00
Beniamino Galvani 329902339e initrd: support the rd.net.dhcp.retry argument
Since we always set autoconnect-retries=1, use the value of
rd.net.dhcp.retry as a multiplier for the DHCP timeout.

(cherry picked from commit 099ce63888)
2021-02-17 11:29:26 +01:00
Beniamino Galvani 772b213321 initrd: accept 'infinity' as argument to rd.net.timeout.dhcp
(cherry picked from commit 97833237bf)
2021-02-17 11:29:26 +01:00
Beniamino Galvani 936c7c9a78 initrd: set autoconnect-retries=1 and increase default DHCP timeout
By default a connection is retried 4 times before it is blocked from
autoconnecting. This means that if a user specifies an explicit DHCP
timeout in the initrd command line, NM will wait up to 4 times more.

Instead, set the "connection.autoconnect-retries" property of
connections always to 1, so that NM only waits for the time
specified.

Before this commit a default DHCP connection would take at most (45 x
4) seconds. Since the multiplier is now only 1, also increase the DHCP
timeout to have a total time of (90 x 1) seconds, which is the half
than before.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/559
(cherry picked from commit 7e126fe898)
2021-02-17 11:29:26 +01:00
Beniamino Galvani 2b3acd1045 initrd: merge branch 'bg/initrd-timeout'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/559
2021-02-17 11:28:00 +01:00
Beniamino Galvani 099ce63888 initrd: support the rd.net.dhcp.retry argument
Since we always set autoconnect-retries=1, use the value of
rd.net.dhcp.retry as a multiplier for the DHCP timeout.
2021-02-17 11:20:18 +01:00
Beniamino Galvani 97833237bf initrd: accept 'infinity' as argument to rd.net.timeout.dhcp 2021-02-17 11:20:18 +01:00
Beniamino Galvani 7e126fe898 initrd: set autoconnect-retries=1 and increase default DHCP timeout
By default a connection is retried 4 times before it is blocked from
autoconnecting. This means that if a user specifies an explicit DHCP
timeout in the initrd command line, NM will wait up to 4 times more.

Instead, set the "connection.autoconnect-retries" property of
connections always to 1, so that NM only waits for the time
specified.

Before this commit a default DHCP connection would take at most (45 x
4) seconds. Since the multiplier is now only 1, also increase the DHCP
timeout to have a total time of (90 x 1) seconds, which is the half
than before.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/559
2021-02-17 11:20:17 +01:00
Thomas Haller e258410c87
initrd: cleanup parsing DNS in reader_parse_ip() 2021-02-17 08:48:41 +01:00
Thomas Haller ea198096eb
build: rename build option "--with-polkit-agent-helper-1{-path,}"
Suggested-by: Michael Biebl <biebl@debian.org>
(cherry picked from commit d9968b133b)
2021-02-16 21:55:34 +01:00