Commit graph

13761 commits

Author SHA1 Message Date
Thomas Haller
452ba8408c
build/meson: cleanup tests 2021-02-28 18:56:08 +01:00
Thomas Haller
992402adfb
build/meson: cleanup libnm-client-aux-extern 2021-02-28 18:56:08 +01:00
Thomas Haller
d81b5c4129
build/meson: cleanup libnm-client-impl 2021-02-28 10:44:08 +01:00
Thomas Haller
20c955fd61
build/meson: don't link static library libnm_client_impl with helper
Per convention, we shall no link our static libraries with other static
libraries of our own. The purpose is that we only link static libraries
at the end of each build product (that is, in executables, shared
libraries and shared modules).
2021-02-28 10:42:06 +01:00
Thomas Haller
4c98a45270
build/meson: drop libnm_nm_default_dep dependency 2021-02-28 10:42:06 +01:00
Thomas Haller
478142ddeb
build/meson: cleanup dependencies for libnm-core-aux-extern 2021-02-28 10:42:06 +01:00
Thomas Haller
70836d6a08
build/meson: explicitly link libnm-crypto 2021-02-28 10:42:06 +01:00
Thomas Haller
c9bbd15597
build/meson: explicitly link libnm-core-aux-intern 2021-02-28 10:42:05 +01:00
Thomas Haller
e2004d2849
build/meson: cleanup dependencies for libnm-core-impl 2021-02-28 10:42:05 +01:00
Thomas Haller
e52d59f6c2
build/meson: cleanup dependencies for libnm-core-aux-intern 2021-02-28 10:42:05 +01:00
Thomas Haller
e560b551ae
build/meson: remove unnecessary libnm_core_intern_dep 2021-02-28 10:42:05 +01:00
Thomas Haller
ee41da2281
build/meson: remove unnecessary nm_version_macro_header to create libnm_client_public_enum_sources 2021-02-28 10:42:05 +01:00
Thomas Haller
bb4a10719c
build/meson: cleanup dependencies for libnm-platform 2021-02-28 10:42:04 +01:00
Thomas Haller
08ce50c6d8
build/meson: cleanup dependencies for libnm-base 2021-02-28 10:42:04 +01:00
Thomas Haller
cac8e895b6
build/meson: cleanup dependencies for libnm-udev-aux 2021-02-28 10:42:04 +01:00
Thomas Haller
fd69080c9b
build/meson: cleanup dependencies for libnm-systemd-shared 2021-02-28 10:42:04 +01:00
Thomas Haller
a9540fb927
build/meson: drop libnm_log_core_dep dependency 2021-02-28 10:42:04 +01:00
Thomas Haller
309dccf5f9
build/meson: cleanup libnm-glib-aux dependencies
Avoid dependencies but explicitly link the static library where it is
used.

This also fixes that we linked libnm-log-core into
libnm-settings-plugin-ifcfg-rh.so, which duplicated the symbols
while it should used them from NetworkManager.
2021-02-28 10:42:04 +01:00
Thomas Haller
2665b91288
core: rename level_desc global variable
Symbols in header files should almost always have an "nm" prefix.

That is not purely cosmetic, because core modules (like libnm-device-plugin*.so
and libnm-settings-plugin*so) should re-use the symbols of the NetworkManager
binary. For NetworkManager we generate a linker version script to only expose
the symbols that are needed. It thereby excludes symbols that don't have an "nm"
prefix.

Hence, the plugins otherwise cannot reuse the global symbol.

The only reason that we currently don't have a linker error is because
we also link the logging static library into the plugin modules. That is
wrong, because we should not duplicate these symbols.
2021-02-28 10:42:03 +01:00
Thomas Haller
bdabc9e38c
build/meson: cleanup build for c-util and nettools helper libraries
We have a number of static helper libraries. When a user is using such a
library, they need to set the include search paths (-I) and link with
the static library at the right place.

The first part, the include search path, is now trivial. We no longer
add the individual search paths but everybody uses "-I. -Isrc/".

The second part means that when we build a shared library or an
executable that uses symbols from the static library, we need to link
it. But only then, and not earlier so that not multiple intermediate
build products (static libraries too) contain the same code. Note that
for libnm-device-plugin-*.so and other core plugins it's even that
those shared modules should not themselves link with the static
helpers. Instead, the need to use the symbols from NetworkManager.

Easy enough. Previously, we would sometimes define dependencies in
meson. But as it's really simple, I think that those dependencies
obfuscate more than help. Instead drop them, and only explicitly link
where we need it. The exception is libNetworkManagerTest_dep, which
is still a dependency. Maybe that dependency is fine, as it is much
later in the process. Or maybe that will also be replaced in the future.
2021-02-28 10:41:24 +01:00
Thomas Haller
8bfe1ebcec
build/introspection: cleanup dependencies for libnmdbus in meson 2021-02-24 12:50:25 +01:00
Thomas Haller
7b48d6bd31
build: remove shared/ directory 2021-02-24 12:49:13 +01:00
Thomas Haller
635d84b896
build: remove "shared/" from include search path
There is nothing left there.
2021-02-24 12:49:06 +01:00
Thomas Haller
d6681a0429
shared: move "nm-compat.[hc]" to "src/contrib/"
"nm-compat.h" is not intended to be used by NetworkManager itself.
Instead, it's intended to be copied into the source tree of VPN plugins,
as adapter for different libnm versions.

Move it to "src/contrib/".
2021-02-24 12:49:01 +01:00
Thomas Haller
63622a147a
shared: split and move "nm-vpn-plugin-macros.h"
This file was intended to be used by VPN plugins (by copying it).
However, it was also used internally.

Split the file, and move the internally used part to libnm-glib-aux.
The part that is only there for out of tree users, moves to
"nm-compat.h".
2021-02-24 12:48:56 +01:00
Thomas Haller
ad91579bb8
shared: move "nm-vpn-editor-plugin-call.h" to "src/contrib/" 2021-02-24 12:48:51 +01:00
Thomas Haller
fa288f65f6
shared: move "nm-vpn-plugin-utils.c" to "src/contrib/"
This file is not actually to be used by NetworkManager itself.
Instead, every (glib based) VPN plugin will want something like this,
hence we have a copy here.

Move it to a new directory "src/contrib/".
2021-02-24 12:48:46 +01:00
Thomas Haller
a03a03fbe9
libnm/tests: add static helper library "src/libnm-client-test/"
This helper code is already used by several of our unit tests.
Compile it as a separate library.

Previously, the source code lingered unmotivated under "shared/",
which is confusing.
2021-02-24 12:48:42 +01:00
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
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
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
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
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