Compare commits

..

535 commits
1.52.2 ... main

Author SHA1 Message Date
Beniamino Galvani
a31a644f8b merge: branch 'bg/deprecate-wext'
build: deprecate Wireless Extensions

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2309
2025-12-18 15:14:45 +00:00
Beniamino Galvani
a45163b131 rpm: disable wireless extensions on Fedora
The Fedora kernel is built without WEXT since many years:

https://fedoraproject.org/wiki/Changes/RemoveWirelessExtensions
2025-12-18 16:06:44 +01:00
Beniamino Galvani
de1fcdcc72 build: deprecate Wireless Extensions
Wireless Extensions is the legacy, ioctl-based kernel interface used
to configure Wi-Fi cards. It has been deprecated and replaced by the
cfg80211/nl80211 API since 2007, as it doesn't support modern Wi-Fi
encryption and technologies. Mark it as deprecated, so that we can get
rid of some unmaintained and untested code in a future release.
2025-12-18 16:06:42 +01:00
Beniamino Galvani
a2d147366c Merge branch 'bg/issue1688'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2323
2025-12-17 11:59:20 +01:00
Beniamino Galvani
427a7cf257 nmcli: start the agent only after updating the connection
When connecting to a wifi network and providing the password on the
command line, nmcli first looks if there is a compatible connection to
reuse. If there is not, it creates and activates a new one via a
single call to AddAndActivate().

If there is a compatible connection, nmcli first calls Update() on it
to set the new password and then Activate() to bring it up. Before
that, it registers a secret agent that can prompt for a new password
in case of authentication failure.

However, as soon as nmcli registers a secret agent, NM tries to
activate again the connection if it was blocked due to a previous
authentication failure. This connection attempt is going to fail
because it still uses the old password, as new one hasn't been set via
Update().

Change the order of operations to register the agent after Update()
and before Activate().

Reproducer:

 nmcli device wifi connect SSID password BAD_PASSWORD
 nmcli device wifi connect SSID password GOOD_PASSWORD

Fixes: c8ff1b30fb ('nmcli/dev: use secret agent for nmcli d [wifi] connect')
2025-12-17 10:55:51 +01:00
Beniamino Galvani
3a4e18e302 nmcli: fix "device wifi connect" command with existing connection
Executing this command twice, or when a connection profile already
exists for the SSID:

  nmcli device wifi connect $SSID password $PASSWORD

returns error:

  Error: 802-11-wireless-security.key-mgmt: property is missing.

When setting the password nmcli was wiping the existing wireless
security setting.

Fixes: c8ff1b30fb ('nmcli/dev: use secret agent for nmcli d [wifi] connect')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1688
2025-12-17 10:55:50 +01:00
Íñigo Huguet
8e0825f9cd release: bump version to 1.57.1 (development) 2025-12-12 16:01:44 +01:00
Íñigo Huguet
df8288de7f merge: branch 'ih/strerror_r'
Fix two compilation issues

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2330
2025-12-12 14:36:58 +00:00
Íñigo Huguet
118475d571 ci: build with -D systemdsystemgeneratordir=no
Avoid build failures in some distros.
  ERROR: Assert failed: systemd required but not found, please provide a valid systemd user generator dir or disable it

Fixes: 636fb5ef24 ('systemd: install initrd services using a generator')
2025-12-12 15:24:09 +01:00
Íñigo Huguet
599cc1ed1d std-aux: use _nm_strerror_r
The function strerror_r returns an int per POSIX spec, but GNU version
returns char *. Using it fails the compilation in Alpine, so use
_nm_strerror_r instead that handles both cases.

Fixes: 41e28b900f ('daemon-helper: add read-file-as-user')
2025-12-12 15:07:53 +01:00
Íñigo Huguet
1756ec54e3 merge: branch 'issue1809'
CVE-2025-9615: avoid that non-admin user using other users' certificates.

Closes #1809

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2324
2025-12-12 12:29:41 +00:00
Beniamino Galvani
1a52bbe7c9 libnm: add function to copy a certificate or key as user
Add a new public function nm_utils_copy_cert_as_user() to libnm. It
reads a certificate or key file on behalf of the given user and writes
it to a directory in /run/NetworkManager. It is useful for VPN plugins
that run as root and need to verify that the user owning the
connection (the one listed in the connection.permissions property) can
access the file.
2025-12-12 12:43:15 +01:00
Beniamino Galvani
57eb4a5bc6 vpn: check that plugin supports private connections
Only allow private VPN connections if the VPN plugin declares the
supports-safe-private-file-access capability. Also check that the
private connection doesn't have more than one owner.
2025-12-12 12:42:01 +01:00
Beniamino Galvani
10db4baeb6 vpn: add nm_vpn_plugin_info_supports_safe_private_file_access()
The new API indicates that the VPN plugin supports reading files
(certificates, keys) of private connections in a safe way
(i.e. checking user permissions), or that it doesn't need to read any
file from disk.
2025-12-12 12:41:28 +01:00
Beniamino Galvani
8d8edda3f4 core,libnm-core: introduce property flag for certificate and keys
If we add a new property in the future and it references a certificate
or key stored on disk, we need to also implement the logic to verify
the access to the file for private connections.

Add a new property flag NM_SETTING_PARAM_CERT_KEY_FILE to existing
certificate and key properties, so that it's easier to see that they
need special treatment. Also add some assertions to verify that the
properties with the flag are handled properly.

While at it, move the enumeration of private-files to the settings.
2025-12-12 12:38:50 +01:00
Beniamino Galvani
e85cc46d0b core: pass certificates as blobs to supplicant for private connections
In case of private connections, the device has already read the
certificates and keys content from disk, validating that the owner of
the connection has access to them. Pass those files as blobs to the
supplicant so that it doesn't have to read them again from the
filesystem, creating the opportunity for TOCTOU bugs.
2025-12-12 12:38:50 +01:00
Beniamino Galvani
a1928b4459 device: read private files in stage2
During stage2 (prepare) of an activation, check if the connection is
private and if it contains any certificate/key path. If so, start
reading the files and delay stage2. Once done, store the files'
content into priv->private_files.table and continue the activation.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
9703305122 core: add functions to read private files of connections
Add function nm_utils_read_private_files(). It can be used to read a
list of paths as the given user. It spawns the daemon-helper to read
each path and returns asynchronously a hash table containing the files
content.

Also add nm_utils_get_connection_private_files_paths() to return a
list of file paths referenced in a connection. The function currently
returns only 802.1x file paths for certificates and keys.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
932b85f7e7 supplicant: rename variables
Rename uid to to blob_id, and con_uid to con_uuid.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
4e26403c4a core: support returning binary output from the daemon helper
The full output of the daemon helper is added to a NMStrBuf, without
interpreting it as a string (that is, without stopping at the first
NUL character).

However, when we retrieve the content from the NMStrBuf we assume it's
a string. This is fine for certain commands that expect a string
output, but it's not for other commands as the read-file-as-user one.

Add a new argument to nm_utils_spawn_helper() to specify whether the
output is binary or not. Also have different finish functions
depending on the return type.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
bd2484d1a9 supplicant: remove blobs before adding new ones
When connecting, we add the blobs to the Interface object of the
supplicant. Those blobs are not removed on disconnect and so when we
try to add blobs with the same id, the supplicant returns an error.

Make sure we start from a clean slate on each connection attempt, by
deleting all existing blobs. Probably we should also delete the added
blobs on disconnect, but that's left for a future improvement.
2025-12-12 12:38:48 +01:00
Beniamino Galvani
41e28b900f daemon-helper: add read-file-as-user
Add a new command to read the content of a file after switching to the
given user. This command can be used to enforce Unix filesystem
permissions when accessing a file on behalf of a user.
2025-12-12 12:38:48 +01:00
Beniamino Galvani
6c1e04fc61 helpers: move helper programs to the same directory
Create a new 'nm-helpers' directory for all the helper programs, to
avoid having too many subdirs in the src directory.
2025-12-12 12:38:48 +01:00
Beniamino Galvani
2739850b78 libnm-core, core: add permission helpers
Add utility functions to get the number of users and the first user
from the connection.permissions property of a connection.
2025-12-12 12:38:48 +01:00
Íñigo Huguet
d8f143f601 spec: enable polkit_noauth_group for Fedora <= 43 and RHEL <= 10
In Fedora 44 and RHEL 11, admin users will need to type their password
even on local consoles.
2025-12-12 12:38:48 +01:00
Íñigo Huguet
39143f8bdd polkit: add build option to allow admin users not to type their password
Add a build option to allow installing a Polkit rule that will grant
permissions for admin users without asking for their password if they're
in a local console.

This shouldn't be encouraged, though. It's common practice that admin
users has to introduce their password to make system-wide changes. The
standard polkit policy, without this rule, is auth_admin_keep. This
policy will ask for the password once and won't ask for it again for
~5 minutes, so it is not too unconvenient.

Different distros use different group names for users with admin rights,
typically 'sudo' or 'wheel'. The build option allows to define the
desired group, or to leave it empty to not install the rule.

However, until the previous commit it was allowed that local users (even
non-admin) could do system-wide changes without introducing a password.
This option allows to maintain the same behavior for admin users,
keeping backwards compatibility so we avoid breaking existing scripts,
for example. We cannot achieve the same for non-admin users because
allowing them to create system-wide connection causes security
vulnerabilities that cannot be fixed in any other way.
2025-12-12 12:38:48 +01:00
Íñigo Huguet
0b75d905e5 polkit: remove the modify_system build option
This build option allowed non-admin users to create system-wide
connections. Generally, this is not a good idea as system-wide changes
should be done by administrators.

However, the main reason for the change is that this can be used to
bypass filesystem permissions, among possibly other attacks. As the
daemon runs as root, a user can create a system-wide connection that
uses a certificate from a different user to authenticate in a WiFi
network protected with 802.1X or a VPN, because as root user the daemon
can access to the file.

This patch does not completely fix the issue, as users can still create
private connections specifying a path to another user's connection. This
will be addressed in other patch. However, this patch is needed too,
because in system-wide connections we don't store which user created the
connection, so there woudn't be any way to check his/her permissions.

This is part of the fix for CVE-2025-9615

See: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1809
2025-12-12 12:38:48 +01:00
Íñigo Huguet
13bfa44ceb nm-version: set API_VERSION with MICRO+1 (temporary)
In the past, stable branches used odd micro numbers as development micro
version. Because of that, NM_API_VERSION was defined with MICRO+1 so we
don't get warnings during development.

As we stopped using odd micro=devel it is wrong to set MICRO+1 on odd
releases. Final users of 1.52.3 has NM_API_VERSION 1.52.4.

However, during development we need to have MICRO+1. For example, if we
are working on top of 1.52.3 towards the next 1.52.4, we define new
symbols with NM_AVAILABLE_IN_1_52_4. Because of that, we get compilation
failures until we finally bump to 1.52.4, just before the release. The
CI remains red until then, potentially missing many bugs.

For now, just set MICRO+1 all the time. It is wrong, but it was wrong
half of the time anyway, and at least we'll have a green CI until we
implement a definitive solution.
2025-12-12 12:17:58 +01:00
Beniamino Galvani
dad4da06b1 libnm-core: fix the documentation of the gateway IP property
The D-Bus API documentation of the IPv4 and IPv6 settings say:

* addresses
 	Deprecated in favor of the 'address-data' and 'gateway'
 	properties, but this can be used for backward-compatibility
 	with older daemons. Note that if you send this property the
 	daemon will ignore 'address-data' and 'gateway'.

* gateway
       The gateway associated with this configuration. This is only
       meaningful if "addresses" is also set.

This documentation wrongly suggests that at D-Bus level "gateway"
requires "addresses", while it actually requires "address-data". The
reason for the inconsistency is that the gateway documentation is
common between nmcli and D-Bus and it refers to the "address" GObject
property, not to the D-Bus property.

Fix this inconsistency by not explicitly mentioning the property name.

Fixes: 36156b70dc ('libnm: Override parts of nm-setting-docs.xml')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2319
2025-12-04 16:40:07 +01:00
Jan Vaclav
0b61924048 merge: branch 'jv/fix-rawhide-build'
all: fix NM compilation on rawhide

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2321
2025-12-04 12:01:18 +00:00
Jan Vaclav
d40e88fd02 test-link: test bond with use_carrier=1
`use_carrier` is removed from kernel since 6.18 [1], and returns
the following error if set to 0:
> option obsolete, use_carrier cannot be disabled

This causes a failure of test-link-linux, so let's set it to 1.

[1] https://lore.kernel.org/all/2029487.1756512517@famine/
2025-12-04 11:51:28 +00:00
Jan Vaclav
8e72e6b4fb aux-intern: add explicit cast for strchr()
`addr` is always reallocated in this branch, so it
is safe to cast the result of strchr to char* here
to silence the const-qualifier warning.
2025-12-04 11:51:28 +00:00
Jan Vaclav
9e70f31c8c initrd: remove const qualifier from temporary variable
`argument` is not const, but `tmp` is. We use `tmp`
for reading arguments one by one, but we cannot add
a null byte to separate the key and value if it is const.

Make it non-const, so that `val[0] = '\0';` does not fail.
2025-12-04 11:51:28 +00:00
Jan Vaclav
ac427b25fb core, impl: drop const qualifier from split outputs
We write into the buffer returned by nm_strsplit_set_full(), even
though it is returned as `const char**`. The function description
claims this is fine:

> *   It is however safe and allowed to modify the individual strings in-place,
> *   like "g_strstrip((char *) iter[0])".

Remove the const qualifier via cast so that it does not raise errors.
2025-12-04 11:51:28 +00:00
Jan Vaclav
754b87e1c4 supplicant: separate input and local value
We reallocate this value in the function, which is necessary
because we write into it, and the input is const.

Move the allocation into a local variable instead of overwriting
the input pointer, because we are also pointing to it via
`char* s`, which is not const.
2025-12-04 11:51:28 +00:00
Jan Vaclav
5f6beb0e57 nm-udev-utils: constify strstr-output variable
`subsystem_full` is const, so `s` needs to be const too.
Reorder the NULL-byte write so that we are not writing
into a const char* (the underlying memory is the same).
2025-12-04 11:51:28 +00:00
Jan Vaclav
487ca30256 all: const-ify str(r)chr output variables where possible 2025-12-04 11:51:28 +00:00
Jan Vaclav
a07961cfbe systemd: selectively backport "Fix constness issues with newer glibc"
NetworkManager is failing to build on Rawhide with the following errors:
../src/libnm-systemd-shared/src/basic/string-util.h:33:16: error: return discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   33 |         return strstr(haystack, needle);
      |                ^~~~~~
In file included from ../src/libnm-systemd-shared/src/basic/fd-util.c:30:
../src/libnm-systemd-shared/src/basic/sort-util.h: In function ‘bsearch_safe’:
../src/libnm-systemd-shared/src/basic/sort-util.h:34:16: error: return discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   34 |         return bsearch(key, base, nmemb, size, compar);
      |                ^~~~~~~

This is fixed in systemd by commit 0bac1ed2422f15308414dd1e9d09812a966b0348:
> Latest glibc uses _Generic to have strstr() and other functions return
> const char* or char* based on whether the input is a const char* or a
> char*. This causes build failures as we previously always expected a char*.
>
> Let's fix the compilation failures and add our own macros similar to glibc's
> to have string functions that return a mutable or const pointer depending on
> the input.

Selectively backport the changes we need to fix building.
2025-12-04 11:51:28 +00:00
Jan Vaclav
4e7e159224 merge: branch 'jv/unifcfg-scripts'
build/configure_for_system: stop building with ifcfg_rh support

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2320
2025-12-04 11:50:02 +00:00
Jan Vaclav
ae134ca9f4 build/configure_for_system: stop building with ifcfg_rh support
It has been deprecated for a long time, so it would be probably
fine to stop building with it enabled. RHEL 9 is excluded since
it still supports the ifcfg-rh format.
2025-12-04 11:33:13 +00:00
Jan Vaclav
55f96057c6 build/configure_for_system: disable building with team on rhel10+ 2025-12-04 11:33:13 +00:00
Jan Vaclav
de0a37b248 build: fix rhel version detection in configure_for_system 2025-12-04 11:33:13 +00:00
Beniamino Galvani
7315e7e0ee merge: branch 'saemismatch-signal-handlers'
core: add handlers for SaePasswordMismatch signal

Closes #904

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2293
2025-12-03 16:08:41 +00:00
Mitchell Augustin
bcb96a1b19 core: add handlers for SaePasswordMismatch signal
Trigger a new auth request to the user when the SaePasswordMismatch
signal is received from wpa_supplicant.

Closes #904
2025-12-02 14:25:12 +00:00
Beniamino Galvani
561fff3c8d merge: branch 'main'
connectivity: add per-device check-connectivity setting

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2316
2025-12-02 09:55:34 +00:00
Popax21
a9f2c15663 connectivity: add per-device check-connectivity setting
Adds a new `check-connectivity` setting to the `device` section which can be
used to disable the connectivity check for a particular device.
2025-12-02 10:04:20 +01:00
Beniamino Galvani
8a9b17071b version: add 1.58 macros 2025-11-28 19:05:59 +01:00
Till Maas
c1519bd514 merge: branch 'update_pt_BR'
Update Brazilian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2307
2025-11-26 22:16:53 +01:00
Rafael Fontenelle
8b5a61458b Update Brazilian Portuguese translation
Co-authored-by: Matheus Barbosa <mdpb.matheus@gmail.com>
Co-authored-by: Samuel Schlemper <samuelschlemper2006@gmail.com>
Co-authored-by: Juliano de Souza Camargo <julianosc@pm.me>
2025-11-26 22:16:25 +01:00
Beniamino Galvani
9e01443b14 man: describe the allowed boolean values in NetworkManager.conf
The NetworkManager.conf man page is describing some options as
"whether X is enabled", without explicitly saying that it's a
boolean. Also, the allowed values are not mentioned. Clarify those
aspects.
2025-11-26 09:03:11 +01:00
Beniamino Galvani
78519589b9 NEWS: update 2025-11-26 09:03:08 +01:00
Till Maas
771f86105e merge: branch 'patch-2'
Updated Slovenian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2317
2025-11-24 21:31:56 +01:00
filmsi
b3f9f52505 Updated Slovenian translation 2025-11-24 21:31:55 +01:00
Beniamino Galvani
b41a5ec2d4 merge: branch 'initrd-services-dbus-fix'
systemd: install initrd services using a generator

Closes #1814

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2312
2025-11-20 17:41:45 +00:00
Antonio Alvarez Feijoo
636fb5ef24 systemd: install initrd services using a generator
Since both `NetworkManager.service` and `NetworkManager-initrd.service` are
allocated for the same bus name (`org.freedesktop.NetworkManager`) and this is
not allowed, the best option is to use a systemd generator to install them only
in the initrd, instead of setting fixed Install sections.

Fixes #1814
2025-11-20 13:26:15 +00:00
Beniamino Galvani
d006d61aa1 merge: branch 'main'
core: restrict connectivity check lookups to per-link DNS if available

Closes #1836

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2313
2025-11-20 08:24:08 +00:00
Popax21
6e2de1d2b3 core: restrict connectivity check lookups to per-link DNS if available
Restrict connectivity check DNS lookups to just the relevant link if the link
has a per-link DNS resolver configured. This change was previously discussed as
part of issue
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1836, and
brings NM's behavior back in line with the behavior documented in the man page.

The connectivity check checks for a per-link DNS resolver by querying
systemd-resolved's `ScopeMask` for the link; this involves a small D-Bus
roundtrip, but is ultimately the more flexible solution since it is also capable
of dealing with per-link DNS configuration stemming from other sources.

Fixes: e6dac4f0b6 ('core: don't restrict DNS interface when performing connectivity check')
2025-11-19 14:54:40 +00:00
Beniamino Galvani
4afa00874f merge: branch 'mptcp-laminar'
mptcp: add `laminar` endpoint support and set it by default

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2314
2025-11-19 14:01:05 +00:00
Matthieu Baerts (NGI0)
3ce1da1fd2 NEWS: new MPTCP 'laminar' endpoint & default
A summary linked to the last two commits.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
2025-11-19 12:54:09 +00:00
Matthieu Baerts (NGI0)
8caa781270 mptcp: set the laminar flag by default
By default, the MPTCP limits have 'add_addr_accepted' set to 0. It means
that when the other peer announces an additional address it can be
reached from, the receiver will not try to establish any new subflows to
this address. If this limit is increased, and without the new 'laminar'
flag, the MPTCP in-kernel path-manager will select the source address by
looking at the routing tables to establish this new subflow.

This is not ideal: very likely, the source address will be the one
linked to the default route and a new subflow from the same interface as
the initial one will be created instead of using another path.

This is especially problematic when the other peer has set the 'C-flag'
in the MPTCP connection request (MP_CAPABLE). This flag can be set to
tell the other side that the peer will not accept extra subflows
requests sent to its initial IP address and port: typically set by a
server using an anycast address, behind a legacy Layer 4 load balancer.

It sounds better to add the 'laminar' flag by default to pick the source
address from well-defined MPTCP endpoints, rather than relying on
routing rules which will likely not pick the most interesting solution.

Note that older kernels will accept unsupported flags, and ignore them.
So it is fine to have the new flag added by default even if it is not
supported.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
2025-11-19 12:54:09 +00:00
Matthieu Baerts (NGI0)
2b03057de0 mptcp: add 'laminar' endpoint support
This new endpoint type has been recently added to the kernel in v6.18
[1]. It will be used to create new subflows from the associated address
to additional addresses announced by the other peer. This will be done
if allowed by the MPTCP limits, and if the associated address is not
already being used by another subflow from the same MPTCP connection.

Note that the fullmesh flag takes precedence over the laminar one.
Without any of these two flags, the path-manager will create new
subflows to additional addresses announced by the other peer by
selecting the source address from the routing tables, which is harder to
configure if the announced address is not known in advance.

The support of the new flag is easy: simply by declaring a new flag for
NM, and adding it in the related helpers and existing checks looking at
the different MPTCP endpoint. The documentation now references the new
endpoint type.

Note that only the new 'define' has been added in the Linux header file:
this file has changed a bit since the last sync, now split in two files.
Only this new line is needed, so the minimum has been modified here.

Link: https://git.kernel.org/torvalds/c/539f6b9de39e [1]
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
2025-11-19 12:54:09 +00:00
Beniamino Galvani
3b10b88290 core: fix rate-limit test failures
It's possible that the first timeout gets delayed; therefore the
interval between the first and the second callback can be less than
one second, and the budget doesn't refill completely.

Schedule the second timeout from the first callback to guarantee that
at least one second passes between the callbacks.

Fixes: ff0c4346fc ('core: add rate-limiting helper')
2025-11-18 15:02:05 +01:00
Íñigo Huguet
d687768c61 libnm: move hsr symbols to the right version
These symbols has been added to the 1.54.2 stable branch, so they are
actually available since then.
2025-11-18 10:39:49 +01:00
Íñigo Huguet
239b0fbbc9 release: bump version to 1.57.0 (development) 2025-11-17 16:42:05 +01:00
Íñigo Huguet
29d523391a release: bump version to 1.55.90 (1.56-rc1) 2025-11-17 16:35:34 +01:00
Beniamino Galvani
f4bf54ca93 merge: branch 'bg/ndisc-ratelimit-warns'
ndisc: rate limit messages about invalid RAs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2294
2025-11-12 13:12:25 +00:00
Beniamino Galvani
22631d557a ndisc: rate limit messages about invalid RAs
Sending and receiving RA is repeated periodically. Don't spam logs
with the same message again and again. Rate limit the message to 6
every 12 hours per type and per ndisc instance.
2025-11-12 14:05:30 +01:00
Beniamino Galvani
ff0c4346fc core: add rate-limiting helper
It can be used to perform an action like logging a message with
simple rate limiting.
2025-11-12 11:48:59 +01:00
Jan Vaclav
5f85b55f7f NEWS: update
Fixes: 04ddd72ce9 ('merge: branch 'jv/import-nacd'')
2025-10-30 12:34:16 +01:00
Beniamino Galvani
461c9edfb4 merge: branch 'main'
Correctly apply some connection properties to vpn connections

Closes #1109

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2279
2025-10-27 09:46:41 +00:00
Robin Ebert
306f9c490b vpn: Use nm_device_create_l3_config_data_from_connection if possible
Using nm_device_create_l3_config_data_from_connection in favor of
nm_l3_config_data_new_from_connection allows the connection
properties: connection.mdns, connection.llmnr,
connection.dns-over-tls, connection.dnssec, connection.mptcp-flags,
and ipv6.ip6-privacy to be read from the vpn's connection settings
allowing them to be applied to vpn connections.
2025-10-27 10:31:16 +01:00
Robin Ebert
441e77a44c core: Make nm_device_create_l3_config_data_from_connection behave as expected
Currently nm_device_create_l3_config_data_from_connection uses the
connection applied to the given device for some properties.  Altough
this currently works since all users of
nm_device_create_l3_config_data_from_connection provide the applied
connection as parameter, it behaves unexpectedly when another
connection is given.
2025-10-27 09:58:07 +01:00
Íñigo Huguet
caf156b2ac merge: branch 'ih/fix-ci-pages'
ci: fix pages job

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2303
2025-10-24 11:58:18 +00:00
Íñigo Huguet
ed43e4b602 ci: fix pages job
Fix the rule that triggers this job so it is run each time that a commit
is pushed/merged to main. The incorrect rule was doing that it only ran
when the *source* branch (or a MR) was called "main". Therefore, it was
(almost) never running.

Fixes: 69efb4660c ('CI: periodically clean image's registry')
2025-10-24 12:48:20 +02:00
Íñigo Huguet
384dd7d5f2 merge: branch 'ih/forwarding'
core: ip forwarding: improve performance setting IPv4 forwarding for method=shared and forwarding=auto

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2201
2025-10-24 05:27:36 +00:00
Íñigo Huguet
e06aaba1ca core: mark as managed-type=removed when unrealize
This is needed to ensure that the right CleanupType is chosen when
calling to nm_device_state_changed() a bit later. With this change
CLEANUP_TYPE_REMOVED will be used instead of CLEANUP_TYPE_DECONFIGURE,
which is wrong because the device has already disappeared.
2025-10-24 05:27:18 +00:00
Íñigo Huguet
32cbf4c629 ip: shared: stop using the global forwarding
As we introduced the ipv4.forwarding property in a8a2e6d727 ('ip-config:
Support configuring per-device IPv4 sysctl forwarding option'), we must
not enable or disable the global forwarding setting in the kernel, as it
affects to all the devices, maybe forcing them to behave in a way
different to what the user requested in ipv4.forwarding.

Instead, we need to selectively enable or disable the per-device forwarding
settings. Specifically, only devices activated with ipv4.forwarding=auto
must have their forwarding enabled or disabled depending on shared
connections. Devices with yes/no must not be affected by shared connections.

Also, devices with ipv4.forwarding=auto must get the proper forwarding value
on activation, but also change it when shared connections appear or
disappear dynamically. Use the new sharing-ipv4-change signal from
nm_manager to achieve it.

Fixes: a8a2e6d727 ('ip-config: Support configuring per-device IPv4 sysctl forwarding option')
2025-10-24 05:27:18 +00:00
Íñigo Huguet
8faa33b9d4 manager: add sharing-ipv4-changed signal
This signal notifies about the "sharing state", that's it, when there
is at least one shared connection active or not. Each device informs
to nm_manager when a shared connection is activated or deactivated
and nm_manager emits this signal when the first shared connection is
activated or the last one is deactivated.

For now we're only interested in IPv4 forwarding as it's the only one
that we need to track from nm_device (in following commits).

Fixes: a8a2e6d727 ('ip-config: Support configuring per-device IPv4 sysctl forwarding option')
2025-10-24 05:27:18 +00:00
Íñigo Huguet
d58d0a793e ip: restore IP forwarding on device deconfiguration
With the ipv4.forwarding property we may modify the forwarding sysctl of
the device on activation. In next commits, we will also modify it if the
connection is shared, instead of modifying the global forwarding.

Restore the forwarding value to the default one when the device is
deconfigured for any reason.

Fixes: a8a2e6d727 ('ip-config: Support configuring per-device IPv4 sysctl forwarding option')
2025-10-24 05:27:18 +00:00
Íñigo Huguet
f2a2e49d07 Revert "policy: refresh IPv4 forwarding after connection activation and disconnection"
This reverts commit 2ad5fbf025.

It is actually a partial revert. The changes to documentation don't need
to be reverted.

Fixes: 2ad5fbf025 ('policy: refresh IPv4 forwarding after connection activation and disconnection')
2025-10-24 05:27:18 +00:00
Beniamino Galvani
b4e8edbc8a merge: branch 'pskmismatch-signal-handlers'
core: add handlers for PskMismatch signal

Closes #904

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2287
2025-10-23 14:38:43 +00:00
Mitchell Augustin
6dd07a80e5 core: add handlers for PskMismatch signal
Trigger a new PSK request to the user when the PskMismatch
signal is received from wpa_supplicant.

Closes #904
2025-10-23 14:36:54 +00:00
Jan Vaclav
04ddd72ce9 merge: branch 'jv/import-nacd'
n-acd: detect eBPF capability at runtime

Closes #1049

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2300
2025-10-23 13:33:30 +00:00
Íñigo Huguet
58f46a6d11 merge: branch 'localhost'
core: nm-dns-dnsmasq: listen on ipv6 localhost too

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1504
2025-10-23 05:42:34 +00:00
Jan Vaclav
427137d6da service: add CAP_BPF capability to NetworkManager
Since we are now always building n-acd with eBPF, and
are able to detect eBPF support at runtime, we can
reflect this in the unit as well.

Add CAP_BPF to CapabilityBoundingSet, so that NM can
request to create a BPF map when setting up n-acd.
2025-10-22 21:49:56 +02:00
Jan Vaclav
b1614ffb90 l3cfg: add info about n-acd eBPF state to log messages 2025-10-22 21:49:56 +02:00
Jan Vaclav
8d33aaa5b6 build: drop "ebpf" configuration for n-acd compilation
Since we now check whether the user's machine supports
eBPF at runtime, we can drop all of this build machinery.
2025-10-22 21:48:39 +02:00
Jan Vaclav
191ebb439a n-dhcp4: re-import git-subtree for 'src/n-dhcp4'
git subtree pull --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git master --squash
2025-10-22 20:09:41 +02:00
Jan Vaclav
2f35c94628 Squashed 'src/n-dhcp4/' changes from 2707213e3e..0d4dcc9bb4
0d4dcc9bb4 n-dhcp4: introduce n_dhcp4_c_connection_clear_client_ip() helper
433c57ab2e n-dhcp4: Do not set ciaddr in DISCOVER state.
feacc2cccd n-dhcp4: change the default DSCP value to 0
b64e2c62e8 n-dhcp4: support setting the DSCP value
6cfa9d84d0 n-dhcp4: set xid of the DHCP header for RELEASE and DECLINE message

git-subtree-dir: src/n-dhcp4
git-subtree-split: 0d4dcc9bb45d5a63d53a787289ad79823343e624
2025-10-22 20:09:23 +02:00
Jan Vaclav
3a769bca67 n-acd: re-import git-subtree for 'src/n-acd'
git subtree pull --prefix src/n-acd git@github.com:nettools/n-acd.git master --squash
2025-10-22 20:09:16 +02:00
Jan Vaclav
0530af60b3 Squashed 'src/n-acd/' changes from a600afc870..6ac6f7e105
6ac6f7e105 n-acd: runtime eBPF support detection

git-subtree-dir: src/n-acd
git-subtree-split: 6ac6f7e105c06e0c352b78b5a136f87fcb5c7432
2025-10-22 20:09:16 +02:00
Jiri Slaby (SUSE)
a0482a4e35 core: nm-dns-dnsmasq: listen on ipv6 localhost too
Trying to resolve hosts using localhost errors out for ipv6 attempts:
  $ host www.seznam.cz localhost
  ;; communications error to ::1#53: connection refused
  ;; communications error to ::1#53: connection refused
  Using domain server:
  Name: localhost
  Address: 127.0.0.1#53
  Aliases:

  www.seznam.cz has address 77.75.77.222
  www.seznam.cz has address 77.75.79.222
  ;; communications error to ::1#53: connection refused
  ;; communications error to ::1#53: connection refused
  www.seznam.cz has IPv6 address 2a02:598:a::79:222
  www.seznam.cz has IPv6 address 2a02:598:2::1222
  ;; communications error to ::1#53: connection refused
  ;; communications error to ::1#53: connection refused

It's because on some distros (like openSUSE), localhost is defined both
as 127.0.0.1 and ::1.

So listen on ::1 too. This makes ipv4-switchoff easier.
/etc/resolv.conf should likely be updated to contain ::1 eventually too
(see update_dns()).

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1188
2025-10-22 15:42:57 +02:00
Beniamino Galvani
0e121f5658 merge: branch 'bg/dns-no-stub'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2298
2025-10-22 10:01:46 +02:00
Beniamino Galvani
2d438ebef8 dns: specify a temporary file name when writing no-stub-resolv.conf
Using g_file_set_contents() makes it impossible to write a proper
SELinux policy because the function creates a file with a random
suffix, and SELinux file transitions can't match on wildcards.

Use a fixed temporary file name. In this case it's fine because
/run/NetworkManager is only writable by root and NetworkManager is the
only process writing into it.
2025-10-22 09:56:39 +02:00
Beniamino Galvani
c312390932 libnm-glib-aux: add temp name argument to nm_utils_file_set_contents()
In some cases it's useful to specify the name of the temporary file to
be used.
2025-10-22 09:56:39 +02:00
Íñigo Huguet
d06fd85e57 merge: branch 'ih/ovsdb-update-log'
ovs: print clearer logs of the ovsdb "update" event

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2297
2025-10-22 06:07:32 +00:00
Íñigo Huguet
2a63c33712 ovs: print clearer logs of the ovsdb "update" event
These lines says things like "changed a bridge", what seems to mean that
NM is doing the change. Actually, these logs indicate changes that NM is
being notified of, and they may even be external changes.

- Add the "monitor:" prefix to show that it's something that NM is
  monitoring, not doing.
- Say "bridge changed" instead of "changed a bridge", which sounds an
  action that we're doing.
- Print the bridge/port/iface name first, instead of the uuid-like key which
  is not useful for a quick look by a human.
- Print `connection=conn-uuid` instead of just `conn-uuid`, as it's not
  obvious that the uuid refers to the connection.

Before:
  ovsdb: obj[bridge:8c975244-cb0a-4add-8901-c398dcbc27d6]: changed a bridge: br-int, b1ef934d...

After:
  ovsdb: monitor: br-int: bridge changed: obj[bridge:8c975244-cb0a-4add-8901-c398dcbc27d6], connection=b1ef934d...
2025-10-22 06:07:25 +00:00
Beniamino Galvani
ce26d85ad1 merge: branch 'bg/reject-unsupported-conns'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2299
2025-10-21 15:34:19 +02:00
Beniamino Galvani
1e81aaa153 settings: document some data structures 2025-10-21 15:31:58 +02:00
Beniamino Galvani
c1baf09bf9 settings: ignore unsupported connections when they are loaded
In addition to rejecting new connections added via D-Bus when they are
unsupported, also ignore the existing on-disk ones.
2025-10-21 15:31:58 +02:00
Beniamino Galvani
247000deed core: reject new connections if the feature is disabled or removed
If a feature like Wi-Fi, OVS, team, etc. is disabled or no longer
supported, it is better to report an error when the connection is
added via nmcli than accepting the connection and complaining later
about a "missing plugin"; there is no plugin and the connection will
never be able to activate.

Example errors now:
  # nmcli connection add type team
  Error: Failed to add 'team-nm-team' connection: team support is disabled in this build

  # nmcli connection add type gsm
  Error: Failed to add 'gsm' connection: WWAN support is disabled in this build

  # nmcli connection add type wimax nsp 00:99:88:77:66:55
  Error: Failed to add 'wimax' connection: WiMAX is no longer supported

Note that we don't touch libnm-core (the part defining the settings
and properties), as that defines the API of NetworkManager. The API
should not change according to compile flags.
2025-10-21 15:31:58 +02:00
Íñigo Huguet
e5ae988603 merge: branch 'fix-autoreconnection'
Fix: unblock autoreconnect when a previously failed connection is now successful

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2295
2025-10-21 09:43:05 +00:00
Antoine Lassagne
03791e8b2d Fix: unblock autoreconnect when a previously failed connection is now successful 2025-10-21 09:39:52 +00:00
Beniamino Galvani
965aa81027 device: set bridge in supplicant for 802.1X ethernet and macsec
When authenticating via 802.1X, the supplicant must be made aware of
the bridge the interface is attached to. This was already done for
wifi in commit ae31b4bf4e ('wifi: set the BridgeIfname supplicant
property when needed'). When setting the BridgeIfname property, the
supplicant opens an additional socket to listen on the bridge, to
ensure that all incoming EAPOL packets are received.

Without this patch, the initial authentication usually works because
it is started during stage2 (prepare), when the device is not yet
attached to the bridge, but then the re-authentication fails.

Note: I could reproduce the problem only when the bridge is configured
with bridge.group-forward-mask 8.

Resolves: https://issues.redhat.com/browse/RHEL-121153
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2301
2025-10-21 11:26:08 +02:00
Jan Vaclav
86b67233bf merge: branch 'jv/hsr-interlink'
libnm: introduce `hsr.interlink` property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2285
2025-10-13 10:42:51 +00:00
Beniamino Galvani
a148232789 merge: branch 'dnssec'
Add support for systemd-resolved's DNSSEC option

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2278
2025-10-13 10:10:34 +00:00
Robin Ebert
2bc895c0e9
NEWS: add new connection.dnssec feature to NEWS 2025-10-13 11:58:11 +02:00
Robin Ebert
c6a6801b1e
ifcfg-rh: throw error if connection.dnssec is used 2025-10-13 11:57:54 +02:00
Robin Ebert
46306c1be0
cli: add support for connection.dnssec 2025-10-13 11:57:53 +02:00
Robin Ebert
1dcd63ab5d
core: add support for connection.dnssec 2025-10-13 11:57:53 +02:00
Robin Ebert
029f8be4c1
libnm-core: Add connection.dnssec property 2025-10-13 11:57:34 +02:00
Íñigo Huguet
e6a31264c1 merge: branch 'ih/ovs-external-ports'
ovs: don't remove unrelated external ports

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2296
2025-10-13 06:58:30 +00:00
Íñigo Huguet
86ea2c5963 man: ovs: document known limitation when removing ifaces and ports
Document a known limitation that we delete bridges and ports from ovsdb
when we remove their last NM-owned attached port or interface, even if
other externally added ports or interfaces exist.
2025-10-13 06:58:23 +00:00
Íñigo Huguet
93491d76ec ovs: don't remove unrelated external ports
The commit linked below introduced a bug that caused that OVS ports
added externally to NM are always deleted when we delete any OVS
interface. It affects to all externally added ports, including those
that are not related to the deleted interface and even those in
different OVS bridges.

Fix it by only modifying ports and bridges that are ascendants of the
deleted interface, leaving everything else untouched.

Note that bridges and ports still need to have at least one NM-managed
interface, otherwise they will also be purged. For example, an NM-owned
OVS bridge with 2 ports+iface, one NM-owned and one external: if we
delete the NM-owned iface, both ports and the bridge will be deleted.
For now, this is a known limitation that is not being fixed here.

Fixes: 476c89b6f2 ('ovs: only keep bridges and ports with NM interfaces attached')
2025-10-13 06:58:23 +00:00
Íñigo Huguet
b271e0a051 merge: branch 'filmsi/update-po'
Update Slovenian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2292
2025-10-10 14:51:37 +00:00
filmsi
f0f4d0dba0 Update Slovenian translation 2025-10-10 14:51:16 +00:00
Íñigo Huguet
4e10b1e6ab merge: branch 'hotfix/mstrodl/no-operator-code-retry'
wwan: retry after no operator code

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2270
2025-10-10 12:21:23 +00:00
Mary Strodl
52d08008b7
wwan: retry after no operator code
We've had a few rare instances where a modem stopped retrying
to autoconnect because it briefly didn't have an operator code.

This isn't a permanent failure, so we shouldn't abort completely
for it.
2025-10-10 08:16:57 -04:00
Íñigo Huguet
92aeed1f5c merge: branch 'patch-1'
Fix the exit test condition on modem state when creating the connection properties

Closes #1741

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2247
2025-10-09 06:42:22 +00:00
Christian Müller
018c5722ee Fix the exit test condition on modem state when creating the connection properties 2025-10-09 06:42:22 +00:00
Jan Vaclav
bf8b38618a NEWS: update 2025-10-08 22:52:14 +02:00
Jan Vaclav
17efec8b06 platform: configure HSR interlink from property
Uses the `hsr.interlink` property defined in the previous
commit to configure the property in the kernel.
2025-10-08 22:52:03 +02:00
Jan Vaclav
69d0fb161e libnm: introduce hsr.interlink property
This property allows the user to optionally configure
an interlink name on a HSR interface, so that it could
serve as RedBox (Redundant Box) by connecting DAN (dual
attachment node) to SAN (single attachment node).
2025-10-08 22:52:03 +02:00
Jan Vaclav
59c65bc859 merge: branch 'sktranslation_update'
Update Slovak translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2286
2025-10-07 10:31:27 +02:00
Jan Vaclav
a46827f899 merge: branch 'jv/hsr-version'
libnm: introduce `hsr.protocol-version` property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2283
2025-10-06 09:02:04 +00:00
Íñigo Huguet
6801ce4927 merge: branch 'catalan_fixes'
Fixes to Catalan translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2289
2025-10-03 11:21:26 +00:00
Jordi Mas
6e32a8e821 Fixes to Catalan translation 2025-10-03 11:21:15 +00:00
Íñigo Huguet
13d7469ba0 merge: branch 'wwan-device-name-restriction'
add gsm device-uid setting to restrict the devices the connection applies to

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2176
2025-10-03 11:03:13 +00:00
Michael Mokricky
820e56c5df add gsm device-uid setting to restrict the devices the connection applies to 2025-10-03 11:02:21 +00:00
Jan Vaclav
c27caec33d NEWS: update 2025-09-30 14:29:00 +02:00
Jan Vaclav
0b99629278 platform: configure HSR protocol version from property
Uses the `hsr.protocol-version` property defined in the previous
commit to configure the property in the kernel.
2025-09-30 14:28:49 +02:00
Jan Vaclav
9a2395c779 libnm: introduce hsr.protocol-version property
This property allows the user to set the protocol
version when using HSR. Currently, the property
supports two values - `2010` (referred to as HSRv0
in the kernel), and `2012` (HSRv1).
2025-09-30 14:28:48 +02:00
Jose Riha
ddb31034f9 Update Slovak translation 2025-09-26 17:34:34 +02:00
Íñigo Huguet
9e0551aefd core: document CleanupType
We must do different cleanups depending on the CleanupType. Document the
meaning of the different types as it was very confusing to work on new
code without having very clear what do they mean.
2025-09-24 11:30:59 +02:00
Íñigo Huguet
dbec15eb8d merge: branch 'ih/net-off-logging'
Improve logging of `networking off`

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2284
2025-09-24 05:21:21 +00:00
Íñigo Huguet
48fc40e1ca core: rename unmanaged flag SLEEPING->MANAGER_DISABLED
The flag is used for both sleeping and networking disabled conditions.
This is because internally they share logic, but it's not obvious for
users and it has caused confusion in the past when investigating why
devices didn't become managed. Make it explicit that it can be because
of either reason.

It would be better to create two separate flags, actually, and it
doesn't seem complex, but better not to risk introducing bugs for that
little benefit.

Logs before:
  device (enp4s0): state change: disconnected -> unmanaged (reason 'unmanaged-sleeping' ...

Logs before:
  device (enp4s0): state change: disconnected -> unmanaged (reason 'unmanaged-nm-disabled' ...
2025-09-23 09:17:07 +02:00
Íñigo Huguet
f6d6a7e2eb core, libnm: add the "networking off" reason
When we disable networking with `nmcli networking off` the reason that
is logged is "sleeping". Explain instead that networking is disabled.

Before:
  device (lo): state change: activated -> deactivating (reason 'sleeping' ...

After:
  device (lo): state change: activated -> deactivating (reason 'networking-off' ...
2025-09-23 09:17:07 +02:00
Íñigo Huguet
3355ba9380 core: rename NM_STATE_ASLEEP to NM_STATE_DISABLED
When we do `nmcli networking off` it's shown as state "sleeping". This
is confusing, and the only reason is that we share internally code to
handle both situations in a similar way.

Rename the state to the more generic name "disabled", situation that can
happen either because of sleeping or networking off.

Clients cannot differentiate the exact reason only with the NMState value,
but better that they show "network off" as this is the most common reason
that they will be able to display. If the system is suspending, there will
be only a short period of time that they can show the state, and showing
"network off" is not wrong because that's what NM has done as a response
to suspend.

In the logs, let's make explicit the exact reason why state is changing
to DISABLED: sleeping or networking off.

Logs before:
  manager: disable requested (sleeping: no  enabled: yes)
  manager: NetworkManager state is now ASLEEP

Logs after:
  manager: disable requested (sleeping: no  enabled: yes)
  manager: NetworkManager state is now DISABLED (NEWORKING OFF)

State before:
  $ nmcli general
  STATE  ...
  asleep ...

State after:
  $ nmcli general
  STATE       ...
  network off ...
2025-09-23 09:17:03 +02:00
Íñigo Huguet
c36e0bedeb NEWS: update 2025-09-12 15:11:56 +02:00
Íñigo Huguet
e570498fbf release: bump version to 1.55.4 (development) 2025-09-12 13:38:36 +02:00
Beniamino Galvani
40aa27690c initrd: support setting the DHCP client-id
In some cases it is necessary to set a custom DHCP client-id during
early boot. For example, the firmware of some InfiniBand NIC uses a
48-bit MAC derived from the InfiniBand 20-byte MAC when doing
PXE. NetworkManager doesn't have any knowledge of that 48-bit MAC and
uses the full MAC as client-id, therefore getting a different lease.

Introduce a new option 'rd.net.dhcp.client-id' to specify a custom
client-id.

Resolves: https://issues.redhat.com/browse/RHEL-108454

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2277
2025-09-11 17:33:46 +02:00
Íñigo Huguet
f472111e58 merge: branch 'ih/dbus-global-dns'
core: dns: fix the behavior of [global-dns]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2261
2025-09-11 10:26:06 +00:00
Íñigo Huguet
4a46f454da core: keep empty groups from keyfile configs
When reading NetworkManager.conf and NetworkManager-intern.conf we might
need to know if a group is defined or not, even if it's empty. This is
the case, for example, for [global-dns]. If [global-dns] is defined in
NM.conf overwrites the config from NM-intern, and if it's defined in any
of them they overwrite the configs from connections.

Before this patch, defining it as an empty group was ignored:
```
[global-dns]
```

Instead, it was necessary to add at least one key-value to the group.
Otherwise the group was silently ignored.
```
[global-dns]
searches=
```

Keep empty groups so we can take better decissions about overwritting
configs from other sources.
2025-09-11 10:25:36 +00:00
Íñigo Huguet
7fb4724efa core: dns: show in D-Bus if [global-dns] is defined but empty
Clients like nmstate needs to know if the [global-dns] section is
defined or not, so they know if DNS configs from connections are
relevant or not. Expose it in D-Bus by always exposing "searches"
and "options" if it's defined, maybe as empty lists.
2025-09-11 10:25:36 +00:00
Íñigo Huguet
1cba0a3cca dns: make [global-dns] to overwrite configs from connections
According to the documentation, settings from [global-dns] (searches and
options) are always merged with those from connections. However this was
not happening if no [global-dns-domain-*] exists, in which case
connections were ignored. This happened because in the past both global
sections must de defined or undefined. When this was changed to allow
defining only [global-dns], allowing it in the function that generates
the resolv.conf file was forgotten. Fix that now.

Anyway, merging these configs doesn't make much sense. The searches and
options defined in connections probably make sense only for the nameservers
defined in that same connection.

Because of this, make the following change: if global nameservers are
defined, use searches and options from [global-dns] only, because those
defined in connections may not make sense for the global nameservers. If
[global-dns] is missing, assume an empty [global-dns] section.

Also, if no global nameservers are defined, but [global-dns] is, make
that it overwrites the searches and options defined in connections. This
is not ideal, but none of the alternatives is better and at least this
is easy to remember.

So, the resulting rules from above are:
- If [global-dns] is defined, it always overwrite searches and options
  from connections.
- If [global-dns-domain-*] is defined, it always overwrite nameservers
  from connections. It overwrites searches and options too.

Fixes: 1f0d1d78d2 ('dns-manager: always apply options from [global-dns]')
Fixes: f57a848da5 ('man: update documentation about global DNS configuration')
2025-09-11 10:25:36 +00:00
Íñigo Huguet
294131a2a4 core: dbus: accept global DNS configuration without a default domain
Since 1.44 we accept a global-dns section without any global-dns-domain
section, so users can define searches and options without defining any
global DNS servers.

When set from the D-Bus API it was still rejected. Fix it.

Fixes: 1f0d1d78d2 ('dns-manager: always apply options from [global-dns]')
2025-09-11 10:25:36 +00:00
Íñigo Huguet
05efc6e253 merge: branch 'issue1476'
Fix reapply error with lacp_active

Closes #1476

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2275
2025-09-11 09:55:45 +00:00
Pradyumn Rahar
9c48bae3b2 bond: remove lacp_active option from reapply subset
NM_SETTING_BOND_OPTION_LACP_ACTIVE is flagged as BOND_OPTFLAG_IFDOWN in
the kernel and hence should not be in OPTIONS_REAPPLY_SUBSET.

Authored-by: Mohith Kumar Thummaluru <mohith.k.kumar.thummaluru@oracle.com>
Signed-off-by: Mohith Kumar Thummaluru <mohith.k.kumar.thummaluru@oracle.com>
Signed-off-by: Pradyumn Rahar <pradyumn.rahar@oracle.com>
2025-09-11 09:54:52 +00:00
Íñigo Huguet
1789a5b338 merge: branch 'ih/ip-reservation-use-after-free'
core: fix potential use after free

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2280
2025-09-11 09:47:40 +00:00
Íñigo Huguet
0d3fef3bcd core: fix potential use after free
_LOGD uses 'self', so don't unref it until after the _LOGD. Discovered
by Coverity.
2025-09-11 09:47:17 +00:00
Íñigo Huguet
4d17064f2a ci: use Fedora 42 as tier 1 a bit more
Switching to Fedora 43 changes the formatting. As Fedora 43 is not
released yet, it might still update clang-format and make it to change
again, as it happened in the past with other versions of Fedora.

Keep F42 until F43 is more stable.
2025-09-11 10:33:22 +02:00
Beniamino Galvani
86c7f1ed14 libnm-core: honor secrets flags when serializing WireGuard peers to D-Bus
If "flags" indicate that only secrets should be serialized and a peer
doesn't contain any secrets, skip it. Otherwise the function would
return a non-empty result when the connection contains no secret,
which causes issues later in the agent manager.

Fixes: e148ec07d5 ('libnm: add NMWireGuardPeer and libnm support for peers')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2244
2025-09-09 16:56:26 +02:00
Beniamino Galvani
d8971cceed merge: branch 'bg/ip-reservation'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2276
2025-09-09 08:41:13 +02:00
Beniamino Galvani
d3e4f3344e core: generalize IP reservation functions
Generalize the functions to reserve an IP address from the netns, so
that it becomes easy to define new IP ranges for different purposes.
2025-09-08 21:38:21 +02:00
Beniamino Galvani
1504d12714 core: add test for nm_netns_shared_ip_reserve() 2025-09-08 21:37:41 +02:00
Íñigo Huguet
5677114e7c merge: branch 'ih/update-distros'
ci: update distros

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2271
2025-09-08 13:50:14 +00:00
Íñigo Huguet
13d8cda04e ci: update distros 2025-09-08 12:58:27 +02:00
Íñigo Huguet
6e67c830fb merge: branch 'main'
Update Russian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2274
2025-09-08 10:48:35 +00:00
jtux270
5aafede823 update Russian translation 2025-09-08 10:48:08 +00:00
Íñigo Huguet
57ea2cf612 merge: branch 'bg/test-client-quotation'
test-client: fix quotation in expected message

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2269
2025-09-08 10:47:37 +00:00
Beniamino Galvani
d559f61423 libnm-client: fix memory leak
The test calls g_main_context_ref() on client_context, which must then
be unreferenced.

Fixes: 88724ff169 ('libnm: add nm_client_wait_shutdown() function for cleaning up NMClient')
2025-09-08 10:47:10 +00:00
Beniamino Galvani
5ad712974e test-client: fix quotation in expected message
With the newer glib and libc in F42 and Ubuntu devel, the
"{left,right} double quotation mark" characters are printed in the
output message. The double quotation marks are multi-byte characters
and they can't be matched using a character class []. Update the
regexp accordingly.
2025-09-08 10:47:10 +00:00
Íñigo Huguet
0ac63a4197 merge: branch 'bg/die-autotools'
build: remove autotools leftovers

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2268
2025-09-08 10:46:54 +00:00
Beniamino Galvani
fcf9b60cc2 build: remove autotools leftovers 2025-09-08 10:46:44 +00:00
Íñigo Huguet
7c0510ba0b merge: branch 'patch-1'
Replace sl.po (translated another 400 strings).

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2267
2025-09-08 10:46:04 +00:00
filmsi
26ac482f1c Replace sl.po (translated another 400 strings). 2025-09-08 10:45:56 +00:00
Beniamino Galvani
6c84a19eb2 merge: branch 'use-dynsym-for-exports'
build: use .dynsym for selecting symbols to export

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2262
2025-09-03 12:15:00 +00:00
Mateusz Mikuła
e5884cfb18 build: use .dynsym for selecting symbols to export
Nm uses .symtab by default which is less reliable for this use case.

Previously this would fail if user enabled stripping or used linker
that doesn't add undefined symbols to .symtab, like here:
https://github.com/davidlattimore/wild/issues/819#issuecomment-3215079862
2025-09-03 07:14:53 +00:00
Beniamino Galvani
7242c478a1 manager: unrealize device again after failure
If the device was realized in _internal_activate_device() and the
activation failed to start, unrealize the device again so that it
doesn't stay around.

Fixes-test: @ovs_delete_connecting_interface

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2263
2025-09-02 10:16:58 +02:00
Íñigo Huguet
d39179bee4 merge: branch 'ih/fix-wifi-dispose'
wifi: don't recheck  auto-activate on disposal

Closes #1791

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2259
2025-08-27 06:37:48 +00:00
Íñigo Huguet
3904135150 wifi: don't recheck auto-activate on disposal
During disposal we're calling to remove_all_aps that in turns schedules
an auto-activate recheck. As the device is removed, this triggers an
assertion when trying to do the recheck.

Fix that by not scheduling the recheck.

Example of backtrace that this commits fix:
  0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
  1  0xf746e270 in __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=<optimized out>) at pthread_kill.c:43
  2  0xf743fbc6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
  3  0xf7431614 in __GI_abort () at abort.c:79
  4  0xf775afea in g_assertion_message (domain=domain@entry=0x209a9f "nm", file=file@entry=0x1f7d59 "../NetworkManager-1.43.7/src/core/nm-policy.c", line=line@entry=1665,
     func=func@entry=0x1f94d9 <__func__.6> "nm_policy_device_recheck_auto_activate_schedule",
     message=message@entry=0x1d3e950 "assertion failed: (g_signal_handler_find(device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, NM_POLICY_GET_PRIVATE(self)) != 0)")
     at ../glib-2.72.3/glib/gtestutils.c:3253
  5  0xf775b05e in g_assertion_message_expr (domain=0x209a9f "nm", file=0x1f7d59 "../NetworkManager-1.43.7/src/core/nm-policy.c", line=1665,
     func=0x1f94d9 <__func__.6> "nm_policy_device_recheck_auto_activate_schedule",
     expr=0x1f8afc "g_signal_handler_find(device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, NM_POLICY_GET_PRIVATE(self)) != 0") at ../glib-2.72.3/glib/gtestutils.c:3279
  6  0x0005f27a in nm_policy_device_recheck_auto_activate_schedule (self=0x1d3e950, device=0x209a9f) at ../NetworkManager-1.43.7/src/core/nm-policy.c:1679
  7  0x000548ae in nm_manager_device_recheck_auto_activate_schedule (self=<optimized out>, device=<optimized out>) at ../NetworkManager-1.43.7/src/core/nm-manager.c:3113
  8  0x00070622 in nm_device_recheck_auto_activate_schedule (self=<optimized out>) at ../NetworkManager-1.43.7/src/core/devices/nm-device.c:9249
  9  0xf693aa8c in ap_add_remove (self=self@entry=0x1ceb0b0, is_adding=0, ap=<optimized out>, recheck_available_connections=0)
     at ../NetworkManager-1.43.7/src/core/devices/wifi/nm-device-wifi.c:846
  10 0xf693bcda in remove_all_aps (self=self@entry=0x1ceb0b0) at ../NetworkManager-1.43.7/src/core/devices/wifi/nm-device-wifi.c:863
  11 0xf693f83c in dispose (object=0x1ceb0b0) at ../NetworkManager-1.43.7/src/core/devices/wifi/nm-device-wifi.c:3809
  12 0xf7806e72 in g_object_unref (_object=<optimized out>) at ../glib-2.72.3/gobject/gobject.c:3636
  13 g_object_unref (_object=0x1ceb0b0) at ../glib-2.72.3/gobject/gobject.c:3553
  14 0x000f7fa4 in _nm_dbus_object_clear_and_unexport (location=location@entry=0xffa50644) at ../NetworkManager-1.43.7/src/core/nm-dbus-object.c:203
  15 0x000576e4 in remove_device (self=self@entry=0x1c9c900, device=<optimized out>, quitting=quitting@entry=1) at ../NetworkManager-1.43.7/src/core/nm-manager.c:2289
  16 0x0005a864 in nm_manager_stop (self=self@entry=0x1c9c900) at ../NetworkManager-1.43.7/src/core/nm-manager.c:7784
  17 0x00023438 in main (argc=<optimized out>, argv=<optimized out>) at ../NetworkManager-1.43.7/src/core/main.c:530

Fixes: 96f40dcdcd ('wifi/ap: explicitly unexport AP and refactor add/remove AP')
Fixes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1791
2025-08-27 06:37:33 +00:00
Beniamino Galvani
0b03614b68 device: ensure that sw devices are unrealized after connection deletion
When a software device becomes deactivated, we check whether it can
be unrealized (= deleted in kernel), by calling function
delete_on_deactivate_check_and_schedule().

The function returns without doing anything if there is a new
activation enqueued on the device (priv->queued_act_request), because
in that case the device will be reused for the next activation.

This commit fixes a problem seen in NMCI test
@ovs_delete_connecting_interface: sometimes the device is not
unrealized after deleting the connection. That happens because if the
queued activation fails, we never try again to unrealize the device.

Fix that by calling delete_on_deactivate_check_and_schedule() when
there is a failure starting the queued activation.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2258
2025-08-26 20:51:32 +02:00
Beniamino Galvani
8b26cb35ee device: explicitly handle unrealized devices in is_available()
Unrealized software devices are always available for activation,
hardware devices never.

In nm_manager_get_best_device_for_activation() we call
nm_device_is_available() on candidate devices. Without this fix, any
unrealized software device would be not considered ready for
activation, which is wrong.

A software device can override the default implementation of
is_available(). For example NMDeviceOvsInterface does that and only
checks the OVSDB is ready.

Fixes: ba86c208e0 ('Revert "core: prevent the activation of unavailable OVS interfaces only"')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2253
2025-08-26 20:39:18 +02:00
Íñigo Huguet
96be0cf049 merge: branch 'ih/domain-search-sep'
dns: ensure that no wrong separators are used for DNS search domains

Closes #1740

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2196
2025-08-26 09:00:18 +00:00
Íñigo Huguet
b0b72dd2f1 dns: don't break existing configs with wrong separators in dns-search
The previous commit will raise an error if wrong list
separators are being used in an nmconnection file for dns-search to
avoid that they are all considered a single string.

However, existing users might have wrong values of dns-search that
currently are not preventing the connection of being activated. To avoid
that a NetworkManager update breaks existing configs, potentially even
cutting connectivity with remote machines, accept wrong separators in
keyfiles but emitting a warning.

Fixes: 919156552ede ('dns: ensure that no wrong separators are used for DNS search domains')
2025-08-26 08:59:37 +00:00
Íñigo Huguet
3266203bf1 dns: ensure that no wrong separators are used for DNS search domains
If wrong separators are used in they keyfile, like commas, the whole
line is considered as a single domain string, like "a.org,b.org".
Obviously this is invalid.

Ideally we should validate that the string is a valid domain, but this
gets quite complex if we want to support unicode characters, which are
valid for many top domains. For now, validate at least that no wrong
separators have been used.

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1740
2025-08-26 08:59:37 +00:00
Beniamino Galvani
21bbe24fee merge: branch 'nbft-parser-2'
nm-initrd-generator: Add NBFT tests

Closes #1756

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2256
2025-08-26 08:01:09 +00:00
Tomas Bzatek
dce149352d nm-initrd-generator: add NBFT parser tests
This adds simple unit tests for most common NBFT deployments.
Sample data were mostly taken from the upstream libnvme repository.
2025-08-26 07:45:53 +00:00
Tomas Bzatek
592a4f077b nm-initrd-generator: fix a conn_name leak 2025-08-26 07:45:53 +00:00
Tomas Bzatek
6304d51440 nm-initrd-generator: rework NBFT HFI DHCP detection
There are several flags specified in the NVMe Boot Specification
that may indicate DHCP was used to acquire information during the
pre-OS phase. This commit considers these additional sources,
based on actual NBFT table contents from different systems.

Although we've seen slight variations in firmware implementations
regarding the HFI IP Origin values when DHCP was configured, the
new set of rules still align with expectations.
2025-08-26 07:45:53 +00:00
Beniamino Galvani
0c1fba5c95 wireguard: don't add peer routes if they duplicate prefix routes
With this configuration:

  [Interface]
  ...
  Address = 172.16.110.116/28,172.16.111.21/28

  [Peer]
  ...
  AllowedIPs = 172.16.110.112/28

  [Peer]
  ...
  AllowedIPs = 172.16.111.16/28

NetworkManager currently creates the following routes

  (1) 172.16.110.112/28 dev wg0 proto static scope link metric 50 <-- peer route
  (2) 172.16.110.112/28 dev wg0 proto kernel scope link src 172.16.110.116 metric 50 <-- prefix route
  (3) 172.16.111.16/28 dev wg0 proto static scope link metric 50 <-- peer route
  (4) 172.16.111.16/28 dev wg0 proto kernel scope link src 172.16.111.21 metric 50 <-- prefix route

If we try to reach a host in the second peer subnet, route (4)
matches. Route (4) doesn't specify a source IP and so the kernel will
use the first IP set on the interface (172.16.110.116), which is the
wrong one.

  # ip route get 172.16.111.17
  172.16.111.17 dev wg0 src 172.16.110.116 uid 0

To fix this problem, if the AllowedIP subnet is already reachable on
the interface via the prefix route of a static IP address, we should
skip adding the peer route.

wg-quick does something similar here:

  https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash?h=v1.0.20250521#n177

The condition in wg-quick is a bit different because it checks that no
duplicate route exists on the interface. We can't do exactly the same
because in NMDeviceWireGuard we don't have visibility on all the
platform routes.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1790
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2254
2025-08-25 16:49:16 +02:00
Íñigo Huguet
933ddab90f merge: branch 'ih/close-parenthesis'
libnmc: fix typo of missing close parenthesis

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2249
2025-08-25 13:35:33 +00:00
Íñigo Huguet
f5c5bcc99d libnmc: fix typo of missing close parenthesis 2025-08-25 13:35:33 +00:00
Íñigo Huguet
7b4d0ef9f2 merge: branch 'ih/release-vpn-gnome'
doc: update the process to release a VPN plugin

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2252
2025-08-25 13:34:54 +00:00
Íñigo Huguet
79ffe55686 doc: update the process to release a VPN plugin 2025-08-25 13:34:54 +00:00
Beniamino Galvani
94d7dd9b11 rpm: change system_ca_path
/etc/pki/tls/cert.pem was a symlink to
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem since Fedora 19 and
it is being removed in Fedora 43.

See https://fedoraproject.org/wiki/Changes/droppingOfCertPemFile

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2257
https://bugzilla.redhat.com/show_bug.cgi?id=2380436
2025-08-25 15:19:47 +02:00
Jan Vaclav
29390b053d merge: branch 'jv/reapply-vfs'
device: add support for reapplying the `sriov.vfs` property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2255
2025-08-21 08:32:57 +00:00
Jan Vaclav
bbe0e9d8c2 NEWS: update 2025-08-20 09:58:52 +02:00
Jan Vaclav
4ba3ffee67 device: add support for reapplying the sriov.vfs property
Adds support for reapplying the `sriov.vfs` property. Note this
does not include `num_vfs`, as the configuration needs to be reset
and reconfigured from scratch in that case.

Previously, if an existing VF is modified (e.g. if we change the `trust`
flag), we reset all VF configurations, and started from scratch. But in
some cases, this is unnecessarily disruptive.

Resolves: https://issues.redhat.com/browse/RHEL-95844
2025-08-20 09:58:52 +02:00
Jan Vaclav
588a69cd1b device: extract sriov platform vf generation to separate function 2025-08-20 09:58:52 +02:00
Beniamino Galvani
11da867072 merge: branch 'bg/dns-server-valid'
libnm: add nm_dns_server_validate()

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2251
2025-08-18 12:04:03 +00:00
Beniamino Galvani
9f76e11a75 libnm: add nm_dns_server_validate()
Add a new public symbol nm_dns_server_validate() that clients can use
to validate a single DNS server before adding it to the connection.
2025-08-14 11:22:41 +02:00
Beniamino Galvani
d62c25ef2f dns: return error from nm_dns_uri_parse()
Return a GError from nm_dns_uri_parse() to indicate why the URI could
not be parsed. This is useful for logging and user reporting.
2025-08-14 09:40:26 +02:00
Beniamino Galvani
e1a7d5ac06 device: don't generate an assumed connection for ports on wake
After resuming from suspend, devices with wake-on-lan enabled are
temporarily set as unmanaged, and then managed again. At the beginning
of this process, an active device goes from state ACTIVATED to
UNMANAGED and is deconfigured via
"nm_device_cleanup(cleanup_type=CLEANUP_TYPE_DECONFIGURE)".

If the device is attached to a controller, the cleanup doesn't detach
it. Later when the device is managed again, NetworkManager tries to
create an assumed connection. Normally, this would fail because we
detect that the device is not configured. However, if there is a
controller-port relationship, the assumed connection generation
succeeds and the persistent connection doesn't go up.

As this is wrong, prevent the generation of the assumed connection by
detaching the port during a cleanup.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1766
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2242
2025-08-13 13:43:24 +02:00
Íñigo Huguet
600c5452bf po: fix command that should not be translated
The message contains a literal command that should not be translated,
but it was. Fix it.

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1799
2025-08-12 10:52:29 +02:00
Filip Pokryvka
7562b0e5f9 release: bump version to 1.55.3 (development) 2025-08-01 16:00:58 +02:00
Filip Pokryvka
37dbdd3199 release: bump version to 1.54.0 2025-08-01 15:31:24 +02:00
Íñigo Huguet
4baacfd09d NEWS: update 2025-08-01 14:23:53 +02:00
Beniamino Galvani
a386912ddb platform: fix compilation without LTO
Fix the following error seen when running the build_clean.sh script
with LTO disabled:

  In file included from ../src/libnm-glib-aux/nm-default-glib.h:66,
                   from ../src/libnm-glib-aux/nm-default-glib-i18n-prog.h:13,
                   from ../src/core/nm-default-daemon.h:11,
                   from ../src/core/platform/tests/test-link.c:6:
  In function ‘_nm_auto_freev’,
      inlined from ‘test_link_get_bridge_fdb’ at ../src/core/platform/tests/test-link.c:2732:33:
  ../src/libnm-glib-aux/nm-macros-internal.h:166:8: error: ‘addrs’ may be used uninitialized [-Werror=maybe-uninitialized]
    166 |     if (*p) {
        |        ^
  ../src/core/platform/tests/test-link.c: In function ‘test_link_get_bridge_fdb’:
  ../src/core/platform/tests/test-link.c:2732:33: note: ‘addrs’ was declared here
   2732 |     nm_auto_freev NMEtherAddr **addrs;
        |                                 ^~~~~
  cc1: all warnings being treated as errors

Fixes: 16ef33d380 ('bond-slb: fix memory leak')
(cherry picked from commit b4a22ad2a9)
2025-07-31 15:59:35 +02:00
Beniamino Galvani
1194528b27 nmcli: fix format
Fixes: a9b66e254c ('nmcli: fix compile error')
(cherry picked from commit eff8471de4)
2025-07-31 15:59:34 +02:00
Beniamino Galvani
84c7533760 platform: fix GError free function
Fixes: dd7810c473 ('platform: destroy VFs before changing the eswitch mode')
(cherry picked from commit 394f6281ea)
2025-07-31 15:59:33 +02:00
Beniamino Galvani
43058de07a device: fix signal emission on port detach/release
The "notify::controller" signal must be emitted on the port, not on
the controller.

Fixes: 1f05526ed7 ('core: drop NMDevice master and introduce controller')
(cherry picked from commit 012f1cbfac)
2025-07-31 15:59:32 +02:00
Beniamino Galvani
ca7d42cd7a l3cfg: don't reset the ACD probe timestamp during timer events
acd_data->probing_timestamp_msec indicates when the probing
started. It is used in different places to calculate the timeout for
certain operations. In particular, it is used to detect that the probe
creation took too long when handling the ACD_STATE_CHANGE_MODE_TIMEOUT
event.

If we reset this timestamp at every timer event, we'll never hit the
probe creation timeout. Therefore, the l3cfg will keep trying forever
to create the probe.
See: https://lists.freedesktop.org/archives/networkmanager/2025-July/000418.html

Fix this by not updating the timestamp during a timeout event.

Fixes: a09f9cc616 ('l3cfg: ensure the probing timeout is initialized on probe start')
(cherry picked from commit 407d753a5a)
2025-07-31 15:59:32 +02:00
Beniamino Galvani
2e963061cb l3cfg: fix logging message
Fix spacing in:

 acd[192.168.122.42, probing]: probing currently  stillnot possible
                                                 ^^^^^^^^^

Fixes: b8f9d7b5dd
(cherry picked from commit 74cf2a2bd8)
2025-07-31 15:59:31 +02:00
Beniamino Galvani
8ae10b4148 ndisc: fix logic to limit the number of addresses
Fixes: c2c8c67d8c ('ndisc: rate limit number of accepted RA data to track')
(cherry picked from commit eb7917a387)
2025-07-31 15:59:31 +02:00
Beniamino Galvani
f78dca964f libnm-core: validate the ipvlan mode
The setting must reject unknown ipvlan modes.

Fixes: d238ff487b ('ipvlan: add support to IPVLAN interface')
(cherry picked from commit fdb8f07c44)
2025-07-31 15:59:31 +02:00
Beniamino Galvani
6b01ae3f15 libnm-core: fix p-key validation for Infiniband connections
verify() is setting an error without returning FALSE to make the
validation fail. When the parent is set, the device is a Infiniband
partition and it must have a p-key != -1.

Fixes: d595f7843e ('libnm: add libnm/libnm-core (part 1)')
(cherry picked from commit f4f1ecc7ea)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
976c5dbb5f libnm-core: fix documentation for NMSettingMatch functions
Fixes: 3a8e46f2a5 ('settings: add match for proc cmdline')
(cherry picked from commit 104cafdd44)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
e56bc740d0 core: fix nm_utils_get_nm_gid()
Fixes: 31dbcb81fe ('core: make nm_utils_get_nm_[ug]id() thread safe')
(cherry picked from commit b58a37acfe)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
12e033368f core: fix Wi-Fi data rate tables
Fixes: f2b0092b5b ('wifi: parse BSS IEs for 80211n and 80211ac data rates')
(cherry picked from commit fa80896ee7)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
f4c5ded09b dhcp: fix parsing of the search list option
The DHCP search list option (119) can use the "message compression"
algorithm specified in RFC 1035 section 4.1.4 to reduce the size of
the message in presence of subdomains that appear multiple times.

When using the compression a label starts with:

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    | 1  1|                OFFSET                   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

where the offset points to a previous domain.

Previously, the parsing code was taking the lower 6 bits of the first
byte, shifting them left 16 bits, and adding the next byte. Instead,
the shift should be of 8 bits.

The effect of this bug was that when the offset was greater than 255,
it was incorrectly parsed as a number larger than the message size,
and the parsing failed.

Note that while a single DHCP option can be at most 255 bytes, a DHCP
message can contain multiple instances of the same option. The
receiver must concatenate all the occurrences according to RFC 3396
and parse the resulting buffer.

Fixes: 6adade6f21 ('dhcp: add nettools dhcp4 client')
(cherry picked from commit a9d7abbc50)
2025-07-31 15:59:29 +02:00
Beniamino Galvani
ce40c72812 dhcp: fix typo in tcp_keepalive_interval option name
Fixes: eed205bff3 ('dhcp/internal: move dhcp options management to shared dhcp codebase')
(cherry picked from commit d017dc67b4)
2025-07-31 15:59:29 +02:00
Beniamino Galvani
85edac5d7c bond-slb: fix memory leak
If sendto() fails, the function returns and the remaining entries are
not deallocated. Use nm_auto_freev instead to free the array and the
pointer it contains.

Add a test to check that nm_auto_freev does the right thing on the
value returned by nm_linux_platform_get_bridge_fdb().

Fixes: 3f2f922dd9 ('bonding: send ARP announcement on bonding-slb link/carrier down')
(cherry picked from commit 16ef33d380)
2025-07-31 15:59:29 +02:00
Beniamino Galvani
a909c6f611 platform: rename nm_linux_platform_get_link_fdb_table()
Rename nm_linux_platform_get_link_fdb_table() to
nm_linux_platform_get_bridge_fdb(). The new name better indicates that
the function returns the bridge FDB entries.

(cherry picked from commit 7d23ed9f73)
2025-07-31 15:59:24 +02:00
Beniamino Galvani
9cddd7c0a4 vrf: fix wrong logging domain
Fixes: 667568d1b2 ('core,libnm: add VRF support')
(cherry picked from commit 20a1d7e816)
2025-07-31 15:42:31 +02:00
Beniamino Galvani
051c2f8ea1 lldp: fix memchr() argument order
The validation of embedded NUL character was skipped due to the wrong
order of arguments to memchr(). Fix it.

Fixes: 4043f82790 ('lldp: cleanup converting binary LLDP fields to string')
(cherry picked from commit ce17284c3f)
2025-07-31 15:42:31 +02:00
Beniamino Galvani
d34d564bb4 supplicant: fix wrong check on "EAP" signal arguments
The check is inverted.

Fixes: b83f07916a ('supplicant: large rework of wpa_supplicant handling')
(cherry picked from commit 50a400e16f)
2025-07-31 15:42:31 +02:00
Beniamino Galvani
cbe5da4fd4 libnm-core,core: accept uid/gid up to (2^32 - 2) for tun devices
Linux UIDs/GIDs are 32-bit unsigned integer, with 4294967295 reserved
as undefined.

Before:
  # useradd -u 4294967294 -M testuser
  useradd warning: testuser's uid -2 outside of the UID_MIN 1000 and UID_MAX 60000 range.
  # nmcli connection add type tun ifname tun1 owner 4294967294 ipv4.method disabled ipv6.method disabled
  Error: Failed to add 'tun-tun1' connection: tun.owner: '4294967294': invalid user ID

After:
  # useradd -u 4294967294 -M testuser
  useradd warning: testuser's uid -2 outside of the UID_MIN 1000 and UID_MAX 60000 range.
  # nmcli connection add type tun ifname tun1 owner 4294967294 ipv4.method disabled ipv6.method disabled
  Connection 'tun-tun1' (5da24d19-1723-45d5-8e04-c976f7a251d0) successfully added.
  # ip -d link show tun1
  2421: tun1: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 500
      link/none  promiscuity 0 allmulti 0 minmtu 68 maxmtu 65535
      tun type tun pi off vnet_hdr off persist on user testuser ...
                                                 ^^^^^^^^^^^^^
Fixes: 1f30147a7a ('libnm-core: add NMSettingTun')
(cherry picked from commit 253800238e)
2025-07-31 15:42:30 +02:00
Beniamino Galvani
a509efdbab ovs: fix logging message
Fixes: a259303e1d ('ovs: add support for "other_config" settings')
(cherry picked from commit 55765d2914)
2025-07-31 15:42:30 +02:00
Beniamino Galvani
2478dca1a1 core: fix properties update for HSR devices
Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
(cherry picked from commit 404a3ec853)
2025-07-31 15:42:30 +02:00
Beniamino Galvani
60e7bb86b8 bond: fix attribute assignment macro
Currently the bug is hidden because the macro is only called with
NM_SETTING_BOND_OPTION_ARP_IP_TARGET.

Fixes: 45c95e9314 ('device/bond: rework setting of arp_ip_target bond options')
(cherry picked from commit 1229fe5abd)
2025-07-31 15:42:30 +02:00
Beniamino Galvani
7eaa10fe10 nmcli: fix compile error
Running the build script with LTO disabled
("contrib/fedora/rpm/build_clean.sh -W lto") gives the following error:

  In file included from ../src/libnm-std-aux/nm-default-std.h:102,
                   from ../src/libnm-glib-aux/nm-default-glib.h:11,
                   from ../src/libnm-glib-aux/nm-default-glib-i18n-lib.h:13,
                   from ../src/libnm-client-aux-extern/nm-default-client.h:11,
                   from ../src/nmcli/connections.c:6:
  In function ‘_nm_auto_unref_ptrarray’,
      inlined from ‘do_connection_add’ at ../src/nmcli/connections.c:6069:35:
  ../src/libnm-std-aux/nm-std-aux.h:1106:12: error: ‘props’ may be used uninitialized [-Werror=maybe-uninitialized]
   1106 |         if (*v)                               \
        |            ^
  ../src/libnm-glib-aux/nm-macros-internal.h:91:1: note: in expansion of macro ‘NM_AUTO_DEFINE_FCN0’
     91 | NM_AUTO_DEFINE_FCN0(GPtrArray *, _nm_auto_unref_ptrarray, g_ptr_array_unref);
        | ^~~~~~~~~~~~~~~~~~~
  ../src/nmcli/connections.c: In function ‘do_connection_add’:
  ../src/nmcli/connections.c:6069:35: note: ‘props’ was declared here
   6069 |     gs_unref_ptrarray GPtrArray  *props;
        |                                   ^~~~~
  cc1: all warnings being treated as errors

Fix it.

Fixes: bb850fda0e ('nmcli: connection: process port-type, type and controller first')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2236
(cherry picked from commit a9b66e254c)
2025-07-31 15:42:30 +02:00
Beniamino Galvani
4deee49763 core: accept hostnames longer than 64 characters from DNS lookup
When resolving the system hostname from DNS lookup, we use
nm_utils_validate_hostname() which checks that the result is a valid
hostname. A valid hostname is at most 64 characters on Linux. Anything
longer is discarded.

However, the reverse DNS lookup doesn't return a hostname, it returns
a DNS name. The DNS name can have multiple labels, each limited to 63
characters. The maximum length of the DNS name is 253 characters.

If the result is longer than 64 characters because it has multiple
labels, we should still accept it, provided that it is a valid DNS
name. Then when setting the hostname in the system, only the first
label will be kept.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2243

Resolves: https://issues.redhat.com/browse/RHEL-104357
(cherry picked from commit b019883a9a)
2025-07-23 11:16:45 +02:00
Beniamino Galvani
93ed7a2c38 merge: branch 'bg/misc-fixes2'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2245
2025-07-23 11:13:14 +02:00
Beniamino Galvani
ec996135a9 device: fix comment in attach_port() 2025-07-23 11:12:00 +02:00
Beniamino Galvani
012f1cbfac device: fix signal emission on port detach/release
The "notify::controller" signal must be emitted on the port, not on
the controller.

Fixes: 1f05526ed7 ('core: drop NMDevice master and introduce controller')
2025-07-23 11:11:59 +02:00
Beniamino Galvani
394f6281ea platform: fix GError free function
Fixes: dd7810c473 ('platform: destroy VFs before changing the eswitch mode')
2025-07-23 11:11:59 +02:00
Beniamino Galvani
e4f321c307 merge: branch 'bg/bridge-port-fix-reapply'
bridge: fix reapplying port VLANs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2240

(cherry picked from commit bd41951f1d)
2025-07-23 11:03:10 +02:00
Beniamino Galvani
c647c060d6 device: accept changes to the bond-port.vlans during reapply
Commit c5d1e35f99 ('device: support reapplying bridge-port VLANs')
didn't update can_reapply_change() to accept the "bridge-port.vlans"
property during a reapply. So, it was only possible to change the
bridge port VLANs by updating the "bridge.vlan-default-pvid" property
and doing a reapply. Fix that.

Fixes: c5d1e35f99 ('device: support reapplying bridge-port VLANs')
(cherry picked from commit 261fa8db33)
2025-07-23 11:03:10 +02:00
Beniamino Galvani
956f9ba365 bridge: fix reapplying port VLANs
If the bridge default-pvid is zero, it means that the default PVID is
disabled. That is, the bridge PVID is not propagated to ports.

Currently NM tries to merge the existing bridge VLANs on the port with
the default PVID from the bridge, even when the PVID is zero. This
causes an error when setting the new VLAN list in the kernel, because
it rejects VLAN zero.

Skip the merge of the default PVID when zero.

Fixes: c5d1e35f99 ('device: support reapplying bridge-port VLANs')
(cherry picked from commit bf79fbd678)
2025-07-23 11:03:10 +02:00
Beniamino Galvani
4e986fcbe3 dhcp6: fix accessor macro for t2
sd_dhcp6_lease_get_t2() was returning t1, and so sometimes the client
was going directly to the rebind state skipping the lease renewal.

See the systemd PR: https://github.com/systemd/systemd/pull/38275

Fixes: a14a033efb ('systemd: update code from upstream (2024-02-12)')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2246
(cherry picked from commit 4938507de8)
2025-07-23 11:02:44 +02:00
Beniamino Galvani
4938507de8 dhcp6: fix accessor macro for t2
sd_dhcp6_lease_get_t2() was returning t1, and so sometimes the client
was going directly to the rebind state skipping the lease renewal.

See the systemd PR: https://github.com/systemd/systemd/pull/38275

Fixes: a14a033efb ('systemd: update code from upstream (2024-02-12)')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2246
2025-07-23 11:00:13 +02:00
Beniamino Galvani
3c8c0364a4 merge: branch 'bg/acd-timeout'
l3cfg: don't reset the ACD probe timestamp during timer events

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2241
2025-07-22 08:44:36 +00:00
Beniamino Galvani
eb0a41ce1f l3cfg: simplify the ACD timeouts
ACD_WAIT_PROBING_EXTRA_TIME_MSEC and ACD_WAIT_PROBING_EXTRA_TIME2_MSEC
now are always used together. Consolidate them into a single constant.
2025-07-22 10:24:27 +02:00
Beniamino Galvani
127f73a5c2 l3cfg: fix the interval of the ACD restart timer
After ACD_WAIT_PROBING_EXTRA_TIME_MSEC has elapsed,
_l3_acd_data_timeout_schedule_probing_restart() keeps rescheduling the
timer with a zero interval, resulting in 100% CPU usage. This
continues until the probe is destroyed after
ACD_WAIT_PROBING_EXTRA_TIME2_MSEC.

When computing the interval, we need to use
(ACD_WAIT_PROBING_EXTRA_TIME_MSEC + ACD_WAIT_PROBING_EXTRA_TIME2_MSEC)
as the expiry time.
2025-07-22 10:24:26 +02:00
Beniamino Galvani
407d753a5a l3cfg: don't reset the ACD probe timestamp during timer events
acd_data->probing_timestamp_msec indicates when the probing
started. It is used in different places to calculate the timeout for
certain operations. In particular, it is used to detect that the probe
creation took too long when handling the ACD_STATE_CHANGE_MODE_TIMEOUT
event.

If we reset this timestamp at every timer event, we'll never hit the
probe creation timeout. Therefore, the l3cfg will keep trying forever
to create the probe.
See: https://lists.freedesktop.org/archives/networkmanager/2025-July/000418.html

Fix this by not updating the timestamp during a timeout event.

Fixes: a09f9cc616 ('l3cfg: ensure the probing timeout is initialized on probe start')
2025-07-22 10:24:26 +02:00
Beniamino Galvani
b019883a9a core: accept hostnames longer than 64 characters from DNS lookup
When resolving the system hostname from DNS lookup, we use
nm_utils_validate_hostname() which checks that the result is a valid
hostname. A valid hostname is at most 64 characters on Linux. Anything
longer is discarded.

However, the reverse DNS lookup doesn't return a hostname, it returns
a DNS name. The DNS name can have multiple labels, each limited to 63
characters. The maximum length of the DNS name is 253 characters.

If the result is longer than 64 characters because it has multiple
labels, we should still accept it, provided that it is a valid DNS
name. Then when setting the hostname in the system, only the first
label will be kept.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2243

Resolves: https://issues.redhat.com/browse/RHEL-104357
2025-07-22 10:20:36 +02:00
Beniamino Galvani
b4a22ad2a9 platform: fix compilation without LTO
Fix the following error seen when running the build_clean.sh script
with LTO disabled:

  In file included from ../src/libnm-glib-aux/nm-default-glib.h:66,
                   from ../src/libnm-glib-aux/nm-default-glib-i18n-prog.h:13,
                   from ../src/core/nm-default-daemon.h:11,
                   from ../src/core/platform/tests/test-link.c:6:
  In function ‘_nm_auto_freev’,
      inlined from ‘test_link_get_bridge_fdb’ at ../src/core/platform/tests/test-link.c:2732:33:
  ../src/libnm-glib-aux/nm-macros-internal.h:166:8: error: ‘addrs’ may be used uninitialized [-Werror=maybe-uninitialized]
    166 |     if (*p) {
        |        ^
  ../src/core/platform/tests/test-link.c: In function ‘test_link_get_bridge_fdb’:
  ../src/core/platform/tests/test-link.c:2732:33: note: ‘addrs’ was declared here
   2732 |     nm_auto_freev NMEtherAddr **addrs;
        |                                 ^~~~~
  cc1: all warnings being treated as errors

Fixes: 16ef33d380 ('bond-slb: fix memory leak')
2025-07-17 10:30:18 +02:00
Beniamino Galvani
bd41951f1d merge: branch 'bg/bridge-port-fix-reapply'
bridge: fix reapplying port VLANs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2240
2025-07-14 13:04:00 +00:00
Beniamino Galvani
261fa8db33 device: accept changes to the bond-port.vlans during reapply
Commit c5d1e35f99 ('device: support reapplying bridge-port VLANs')
didn't update can_reapply_change() to accept the "bridge-port.vlans"
property during a reapply. So, it was only possible to change the
bridge port VLANs by updating the "bridge.vlan-default-pvid" property
and doing a reapply. Fix that.

Fixes: c5d1e35f99 ('device: support reapplying bridge-port VLANs')
2025-07-14 15:03:06 +02:00
Beniamino Galvani
bf79fbd678 bridge: fix reapplying port VLANs
If the bridge default-pvid is zero, it means that the default PVID is
disabled. That is, the bridge PVID is not propagated to ports.

Currently NM tries to merge the existing bridge VLANs on the port with
the default PVID from the bridge, even when the PVID is zero. This
causes an error when setting the new VLAN list in the kernel, because
it rejects VLAN zero.

Skip the merge of the default PVID when zero.

Fixes: c5d1e35f99 ('device: support reapplying bridge-port VLANs')
2025-07-14 15:03:05 +02:00
Beniamino Galvani
f655cd1cba man: fix nmcli connection types list
Update the nmcli man page to accurately reflect the connection types
supported by NetworkManager:

- Remove ovs-dpdk and ovs-patch (not supported by nmcli)
- Add hsr, ipvlan, and loopback (missing from the documentation)

This ensures the man page matches the actual connection types returned by
'nmcli --complete-args connection add type'.

https://issues.redhat.com/browse/RHEL-100893
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2235
2025-07-14 14:59:00 +02:00
Filip Pokryvka
c3c7fda42d release: bump version to 1.53.92 (1.54-rc3) (development) 2025-07-11 11:23:04 +02:00
Filip Pokryvka
f584524197 release: bump version to 1.55.2 (development) 2025-07-11 08:33:22 +02:00
Lubomir Rintel
d16a62da2b device: don't disable IPv6 in stage3 on reapply
Currently, when a call to Reapply() results in stage3 being re-run, IPv6
ends up messed up. Like this:

  $ nmcli device modify eth0 ipv4.address ''
  $ nmcli device modify eth0 ipv4.address 172.31.13.37/24
  $

  NetworkManager[666]: <debug> [1751286095.2070] device[c95ca04a69467d81] (eth0): ip4: reapply...
  ...
  NetworkManager[666]: <debug> [1751286095.2104] device[c95ca04a69467d81] (eth0): ip6: addrgenmode6: set none (already set)
  NetworkManager[666]: <debug> [1751286095.2105] device[c95ca04a69467d81] (eth0): ip6: addrgenmode6: toggle disable_ipv6 sysctl after disabling addr-gen-mode
  NetworkManager[666]: <debug> [1751286095.2105] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '1' (current value is '0')
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0' (current value is '1')
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/accept_ra' to '0' (current value is identical)
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0' (current value is identical)

Not only is this unnecessary because addr-gen-mode already has the
desired value (as is logged), but also wipes off all IPv6 configuration.
This is fine on initial configuration, but not on Reapply().

Let's look at the device state first: if we've progressed past ip-config
state, then we can't possibly ever touch the offending sysctls. It's
okay -- we don't need to: addr-gen-mode is going to be set right if we
went through ip-config before.

Resolves: https://issues.redhat.com/browse/NMT-1681

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2232
(cherry picked from commit 9bbb113987)
2025-07-10 16:01:06 +02:00
Beniamino Galvani
74cf2a2bd8 l3cfg: fix logging message
Fix spacing in:

 acd[192.168.122.42, probing]: probing currently  stillnot possible
                                                 ^^^^^^^^^

Fixes: b8f9d7b5dd
2025-07-10 10:04:36 +02:00
Beniamino Galvani
c983e3bbf5 merge: branch 'bg/misc-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2239
2025-07-10 09:14:00 +02:00
Beniamino Galvani
eb7917a387 ndisc: fix logic to limit the number of addresses
Fixes: c2c8c67d8c ('ndisc: rate limit number of accepted RA data to track')
2025-07-10 09:12:06 +02:00
Beniamino Galvani
b45d5f41dd platform: fix harmless typo
The function should modify the "ip6_address" member of the union. In
practice, it doesn't matter because the ifindex is the first member of
both "ip4_address" and "ip6_address".
2025-07-10 09:12:05 +02:00
Beniamino Galvani
fdb8f07c44 libnm-core: validate the ipvlan mode
The setting must reject unknown ipvlan modes.

Fixes: d238ff487b ('ipvlan: add support to IPVLAN interface')
2025-07-10 09:12:05 +02:00
Beniamino Galvani
104cafdd44 libnm-core: fix documentation for NMSettingMatch functions
Fixes: 3a8e46f2a5 ('settings: add match for proc cmdline')
2025-07-10 09:12:04 +02:00
Beniamino Galvani
f4f1ecc7ea libnm-core: fix p-key validation for Infiniband connections
verify() is setting an error without returning FALSE to make the
validation fail. When the parent is set, the device is a Infiniband
partition and it must have a p-key != -1.

Fixes: d595f7843e ('libnm: add libnm/libnm-core (part 1)')
2025-07-10 09:12:04 +02:00
Beniamino Galvani
fa80896ee7 core: fix Wi-Fi data rate tables
Fixes: f2b0092b5b ('wifi: parse BSS IEs for 80211n and 80211ac data rates')
2025-07-10 09:12:03 +02:00
Beniamino Galvani
b58a37acfe core: fix nm_utils_get_nm_gid()
Fixes: 31dbcb81fe ('core: make nm_utils_get_nm_[ug]id() thread safe')
2025-07-10 09:12:03 +02:00
Beniamino Galvani
16ef33d380 bond-slb: fix memory leak
If sendto() fails, the function returns and the remaining entries are
not deallocated. Use nm_auto_freev instead to free the array and the
pointer it contains.

Add a test to check that nm_auto_freev does the right thing on the
value returned by nm_linux_platform_get_bridge_fdb().

Fixes: 3f2f922dd9 ('bonding: send ARP announcement on bonding-slb link/carrier down')
2025-07-10 09:12:02 +02:00
Beniamino Galvani
7d23ed9f73 platform: rename nm_linux_platform_get_link_fdb_table()
Rename nm_linux_platform_get_link_fdb_table() to
nm_linux_platform_get_bridge_fdb(). The new name better indicates that
the function returns the bridge FDB entries.
2025-07-10 09:12:02 +02:00
Beniamino Galvani
d017dc67b4 dhcp: fix typo in tcp_keepalive_interval option name
Fixes: eed205bff3 ('dhcp/internal: move dhcp options management to shared dhcp codebase')
2025-07-10 09:12:02 +02:00
Beniamino Galvani
a9d7abbc50 dhcp: fix parsing of the search list option
The DHCP search list option (119) can use the "message compression"
algorithm specified in RFC 1035 section 4.1.4 to reduce the size of
the message in presence of subdomains that appear multiple times.

When using the compression a label starts with:

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    | 1  1|                OFFSET                   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

where the offset points to a previous domain.

Previously, the parsing code was taking the lower 6 bits of the first
byte, shifting them left 16 bits, and adding the next byte. Instead,
the shift should be of 8 bits.

The effect of this bug was that when the offset was greater than 255,
it was incorrectly parsed as a number larger than the message size,
and the parsing failed.

Note that while a single DHCP option can be at most 255 bytes, a DHCP
message can contain multiple instances of the same option. The
receiver must concatenate all the occurrences according to RFC 3396
and parse the resulting buffer.

Fixes: 6adade6f21 ('dhcp: add nettools dhcp4 client')
2025-07-10 09:12:02 +02:00
Beniamino Galvani
43f738473c core: remove duplicate include 2025-07-10 09:12:01 +02:00
Beniamino Galvani
50a400e16f supplicant: fix wrong check on "EAP" signal arguments
The check is inverted.

Fixes: b83f07916a ('supplicant: large rework of wpa_supplicant handling')
2025-07-10 09:12:01 +02:00
Beniamino Galvani
ce17284c3f lldp: fix memchr() argument order
The validation of embedded NUL character was skipped due to the wrong
order of arguments to memchr(). Fix it.

Fixes: 4043f82790 ('lldp: cleanup converting binary LLDP fields to string')
2025-07-10 09:12:01 +02:00
Beniamino Galvani
20a1d7e816 vrf: fix wrong logging domain
Fixes: 667568d1b2 ('core,libnm: add VRF support')
2025-07-10 09:12:01 +02:00
Beniamino Galvani
1229fe5abd bond: fix attribute assignment macro
Currently the bug is hidden because the macro is only called with
NM_SETTING_BOND_OPTION_ARP_IP_TARGET.

Fixes: 45c95e9314 ('device/bond: rework setting of arp_ip_target bond options')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
404a3ec853 core: fix properties update for HSR devices
Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
62558d50be core: fix constant name for IPv4 method
Fix the name for consistency, even if this is harmless because the
IPv4 and IPv6 values are the same.
2025-07-10 09:12:00 +02:00
Beniamino Galvani
55765d2914 ovs: fix logging message
Fixes: a259303e1d ('ovs: add support for "other_config" settings')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
253800238e libnm-core,core: accept uid/gid up to (2^32 - 2) for tun devices
Linux UIDs/GIDs are 32-bit unsigned integer, with 4294967295 reserved
as undefined.

Before:
  # useradd -u 4294967294 -M testuser
  useradd warning: testuser's uid -2 outside of the UID_MIN 1000 and UID_MAX 60000 range.
  # nmcli connection add type tun ifname tun1 owner 4294967294 ipv4.method disabled ipv6.method disabled
  Error: Failed to add 'tun-tun1' connection: tun.owner: '4294967294': invalid user ID

After:
  # useradd -u 4294967294 -M testuser
  useradd warning: testuser's uid -2 outside of the UID_MIN 1000 and UID_MAX 60000 range.
  # nmcli connection add type tun ifname tun1 owner 4294967294 ipv4.method disabled ipv6.method disabled
  Connection 'tun-tun1' (5da24d19-1723-45d5-8e04-c976f7a251d0) successfully added.
  # ip -d link show tun1
  2421: tun1: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 500
      link/none  promiscuity 0 allmulti 0 minmtu 68 maxmtu 65535
      tun type tun pi off vnet_hdr off persist on user testuser ...
                                                 ^^^^^^^^^^^^^
Fixes: 1f30147a7a ('libnm-core: add NMSettingTun')
2025-07-10 09:12:00 +02:00
Beniamino Galvani
45ab9d96f1 platform: use g_strdup() instead of strdup() in ethtool code
The string is freed with g_free(), it needs to be allocated with
g_strdup(). In practice, the GLib allocator uses malloc() nowadays,
but it is better to be consistent.
2025-07-10 09:12:00 +02:00
Beniamino Galvani
326fb8f9cf initrd: make parsing of VLANs more robust
We are missing some validations when parsing VLANs: a unexpected
argument can cause a crash, an assertion, or the connection being
dropped without any warning. Make it more robust.
2025-07-10 09:12:00 +02:00
Beniamino Galvani
eff8471de4 nmcli: fix format
Fixes: a9b66e254c ('nmcli: fix compile error')
2025-07-09 15:08:15 +02:00
Beniamino Galvani
959ddec2a4 contrib/nm-vpn-plugin-utils: add nm_vpn_plugin_utils_get_cert_path()
Add a function to generate the path for imported certificates.

See https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/merge_requests/95
2025-07-09 15:06:51 +02:00
Beniamino Galvani
a9b66e254c nmcli: fix compile error
Running the build script with LTO disabled
("contrib/fedora/rpm/build_clean.sh -W lto") gives the following error:

  In file included from ../src/libnm-std-aux/nm-default-std.h:102,
                   from ../src/libnm-glib-aux/nm-default-glib.h:11,
                   from ../src/libnm-glib-aux/nm-default-glib-i18n-lib.h:13,
                   from ../src/libnm-client-aux-extern/nm-default-client.h:11,
                   from ../src/nmcli/connections.c:6:
  In function ‘_nm_auto_unref_ptrarray’,
      inlined from ‘do_connection_add’ at ../src/nmcli/connections.c:6069:35:
  ../src/libnm-std-aux/nm-std-aux.h:1106:12: error: ‘props’ may be used uninitialized [-Werror=maybe-uninitialized]
   1106 |         if (*v)                               \
        |            ^
  ../src/libnm-glib-aux/nm-macros-internal.h:91:1: note: in expansion of macro ‘NM_AUTO_DEFINE_FCN0’
     91 | NM_AUTO_DEFINE_FCN0(GPtrArray *, _nm_auto_unref_ptrarray, g_ptr_array_unref);
        | ^~~~~~~~~~~~~~~~~~~
  ../src/nmcli/connections.c: In function ‘do_connection_add’:
  ../src/nmcli/connections.c:6069:35: note: ‘props’ was declared here
   6069 |     gs_unref_ptrarray GPtrArray  *props;
        |                                   ^~~~~
  cc1: all warnings being treated as errors

Fix it.

Fixes: bb850fda0e ('nmcli: connection: process port-type, type and controller first')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2236
2025-07-08 11:21:02 +02:00
Lubomir Rintel
9bbb113987 device: don't disable IPv6 in stage3 on reapply
Currently, when a call to Reapply() results in stage3 being re-run, IPv6
ends up messed up. Like this:

  $ nmcli device modify eth0 ipv4.address ''
  $ nmcli device modify eth0 ipv4.address 172.31.13.37/24
  $

  NetworkManager[666]: <debug> [1751286095.2070] device[c95ca04a69467d81] (eth0): ip4: reapply...
  ...
  NetworkManager[666]: <debug> [1751286095.2104] device[c95ca04a69467d81] (eth0): ip6: addrgenmode6: set none (already set)
  NetworkManager[666]: <debug> [1751286095.2105] device[c95ca04a69467d81] (eth0): ip6: addrgenmode6: toggle disable_ipv6 sysctl after disabling addr-gen-mode
  NetworkManager[666]: <debug> [1751286095.2105] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '1' (current value is '0')
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0' (current value is '1')
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/accept_ra' to '0' (current value is identical)
  NetworkManager[666]: <debug> [1751286095.2106] platform-linux: sysctl: setting '/proc/sys/net/ipv6/conf/eth0/disable_ipv6' to '0' (current value is identical)

Not only is this unnecessary because addr-gen-mode already has the
desired value (as is logged), but also wipes off all IPv6 configuration.
This is fine on initial configuration, but not on Reapply().

Let's look at the device state first: if we've progressed past ip-config
state, then we can't possibly ever touch the offending sysctls. It's
okay -- we don't need to: addr-gen-mode is going to be set right if we
went through ip-config before.

Resolves: https://issues.redhat.com/browse/NMT-1681

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2232
2025-07-07 15:38:51 +02:00
Lubomir Rintel
2de6391f4b device: drop a redundant assert
This is essentially:

  a = b
  assert(a == b)

Not useful.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2233
2025-07-07 15:16:34 +02:00
Íñigo Huguet
a39fa7ee6c merge: branch 'ih/spec_git_tag'
spec: add git_tag_version

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2238
2025-07-07 13:09:50 +00:00
Íñigo Huguet
3cba4f2627 spec: add git_tag_version
The URL to the tarball needs the git tag, that might be 1.54-rc1 instead
of 1.53.90. Allow to define it as a separate variable in the spec file.
It can be set as `git_tag_version %{real_version}` when they are
identical.

It is not really needed here in the upstream spec file, as the "Source"
line is commented out, but add it as a reference for donwstream spec
files.
2025-07-07 09:27:05 +02:00
Íñigo Huguet
cc5306e1d0 NEWS: update 2025-07-07 09:14:34 +02:00
Íñigo Huguet
6eeab380fa NEWS: update 2025-07-07 09:12:59 +02:00
Beniamino Galvani
37c0e0860e NEWS: update 2025-07-01 14:26:44 +02:00
Beniamino Galvani
9e599f07b0 nmcli: accept certain IP settings on port connections
Commit bb850fda0e ('nmcli: connection: process port-type, type
and controller first') started correctly rejecting IP configuration
on port connections.

However, previously nmcli would accept IP parameters for ports when
using a specific parameters order. To avoid breaking user scripts that
may have relied on this behavior, introduce a backward compatibility
quirk.

Specifically, nmcli accepts a disabled/ignore IP method on a port
connection. For any other IP setting on a port connection, a specific
error message is now shown.

https://issues.redhat.com/browse/RHEL-90756
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2227
(cherry picked from commit 165e5df6e0)
2025-07-01 14:22:42 +02:00
Beniamino Galvani
165e5df6e0 nmcli: accept certain IP settings on port connections
Commit bb850fda0e ('nmcli: connection: process port-type, type
and controller first') started correctly rejecting IP configuration
on port connections.

However, previously nmcli would accept IP parameters for ports when
using a specific parameters order. To avoid breaking user scripts that
may have relied on this behavior, introduce a backward compatibility
quirk.

Specifically, nmcli accepts a disabled/ignore IP method on a port
connection. For any other IP setting on a port connection, a specific
error message is now shown.

https://issues.redhat.com/browse/RHEL-90756
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2227
2025-07-01 14:21:23 +02:00
Beniamino Galvani
7c03b3050e manager: add a capability for "sriov.preserve-on-down"
Add a new capability to indicate that NetworkManager supports the
"sriov.preserve-on-down" connection property. With this, clients can
set the property only when supported, without the risk of creating an
invalid connection.

(cherry picked from commit 8e40f7e289)
2025-07-01 09:38:17 +02:00
Beniamino Galvani
25a5fd7503 merge: branch 'bg/sriov-preserve-capability'
manager: add a capability for "sriov.preserve-on-down"

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2234
2025-07-01 07:37:17 +00:00
Beniamino Galvani
9913763185 NEWS: update 2025-07-01 09:33:11 +02:00
Beniamino Galvani
8e40f7e289 manager: add a capability for "sriov.preserve-on-down"
Add a new capability to indicate that NetworkManager supports the
"sriov.preserve-on-down" connection property. With this, clients can
set the property only when supported, without the risk of creating an
invalid connection.
2025-06-30 22:38:18 +02:00
Beniamino Galvani
ea6af6d806 libnm-core: change version of ip4-forwarding capability
NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING was backported to branch
nm-1-54 before the 1.54 release. Update the symbol version.
2025-06-30 22:33:29 +02:00
Beniamino Galvani
9de9fd85a6 libnm: fix g-ir-scanner build warning
Fix the following build warning emitted by g-ir-scanner:

  ../src/libnm-core-public/nm-dbus-interface.h:103: Warning: NM: "@NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING" parameter unexpected at this location:
   * @NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING: Indicates that NetworkManager supports
      ^

Fixes: 6a13e8d369 ('core: expose the version info capability of IPv4 forwarding support')
(cherry picked from commit 7bb898fa12)
2025-06-30 21:25:38 +02:00
Wen Liang
4a727bfae0 core: expose the version info capability of IPv4 forwarding support
This commit adds NM_VERSION_INFO_CAPABILITY_IPV4_FORWARDING to the
VersionInfo D-Bus property, allowing clients such as nmstate to check
the NetworkManager's support of configuring per-device IPv4 sysctl
forwarding setting directly via the capabilities bitmask instead of
relying on the NetworkManager version comparisons.

(cherry picked from commit 6a13e8d369)
2025-06-30 21:25:33 +02:00
Beniamino Galvani
5ab04c8f56 libnm: change "sriov.preserve-on-down" symbols version to 1.54
The "sriov.preserve-on-down" libnm symbols were backported to the 1.54
branch before the final release. Change their version on main to be
"1.54".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2229
2025-06-27 14:11:47 +02:00
Beniamino Galvani
7bb898fa12 libnm: fix g-ir-scanner build warning
Fix the following build warning emitted by g-ir-scanner:

  ../src/libnm-core-public/nm-dbus-interface.h:103: Warning: NM: "@NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING" parameter unexpected at this location:
   * @NM_VERSION_INFO_CAPABILITY_IP4_FORWARDING: Indicates that NetworkManager supports
      ^

Fixes: 6a13e8d369 ('core: expose the version info capability of IPv4 forwarding support')
2025-06-26 13:22:33 +02:00
Beniamino Galvani
9b4569bd94 merge: branch 'bg/route-via'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2222
2025-06-26 11:55:45 +02:00
Beniamino Galvani
24ab3308fe platform: add test for route via attribute 2025-06-26 11:37:17 +02:00
Beniamino Galvani
00257a9cf7 platform: parse the RT_VIA route attribute
Parse the "via" attribute in netlink routes received by kernel, so
that we can update the internal cache.
2025-06-26 11:37:16 +02:00
Beniamino Galvani
9c70a43775 platform: use the "via" attribute in route NMPObject methods
Update the cmd_obj_hash_update(), cmd_obj_cmp(), cmd_obj_to_string()
NMPObject methods for IPv4 routes to consider the "via" attribute.
2025-06-26 11:37:16 +02:00
Mary Strodl
2ffaebd4ae platform: support the RT_VIA attribute for IPv4 routes
The RT_VIA attribute is used to specify a gateway of a different
address family. It is currently used only for IPv4 routes.

[bgalvani@redhat.com: amended the commit message]
2025-06-26 11:37:15 +02:00
Wen Liang
84299ed17c merge: branch 'forwarding_version_info'
core: expose the version info capability sync of forwarding support

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2226
2025-06-24 13:12:28 +00:00
Wen Liang
6a13e8d369 core: expose the version info capability of IPv4 forwarding support
This commit adds NM_VERSION_INFO_CAPABILITY_IPV4_FORWARDING to the
VersionInfo D-Bus property, allowing clients such as nmstate to check
the NetworkManager's support of configuring per-device IPv4 sysctl
forwarding setting directly via the capabilities bitmask instead of
relying on the NetworkManager version comparisons.
2025-06-23 13:30:14 -04:00
Beniamino Galvani
246761a89e merge: branch 'bg/sriov-preserve-on-down'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2219
https://issues.redhat.com/browse/RHEL-69125
(cherry picked from commit a4ee55468f)
2025-06-20 14:42:19 +02:00
Beniamino Galvani
f550cbd547 NEWS: update
(cherry picked from commit 3588c48686)
2025-06-20 14:41:34 +02:00
Beniamino Galvani
ddfc2696e3 device: allow reapplying the sriov.preserve-on-down property
It is useful when there is an already active device and we want to
bring it down preserving the SR-IOV VFs. For example:

  $ nmcli connection add type ethernet ifname eni1np1 sriov.total-vfs 2 ipv4.method disabled ipv6.method disabled
  $ nmcli connection up ethernet-eni1np1

  $ ip link show eni1np1
  342: eni1np1: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
      link/ether 6e:cf:f0:08:74:f4 brd ff:ff:ff:ff:ff:ff
      vf 0     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
      vf 1     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...

  $ nmcli device modify eni1np1 sriov.preserve-on-down yes
  $ nmcli connection down ethernet-eni1np1

  $ ip link show eni1np1
  342: eni1np1: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
      link/ether 6e:cf:f0:08:74:f4 brd ff:ff:ff:ff:ff:ff
      vf 0     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
      vf 1     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...

(cherry picked from commit 6f219aa649)
2025-06-20 14:41:34 +02:00
Beniamino Galvani
c88d75ac6a core: use the sriov.preserve-on-down property
(cherry picked from commit c70b4a98a3)
2025-06-20 14:41:33 +02:00
Beniamino Galvani
8a5e7014d6 libnm,nmcli: add sriov.preserve-on-down property
Add a new "sriov.preserve-on-down" property that controls whether
NetworkManager preserves the SR-IOV parameters set on the device when
the connection is deactivated, or whether it resets them to their
default value. The SR-IOV parameters are those specified in the
"sriov" setting, like the number of VFs to create, the eswitch
configuration, etc.

(cherry picked from commit eb0a22a162)
2025-06-20 14:41:33 +02:00
Filip Pokryvka
aeadb9f6af release: bump version to 1.53.91 (1.54-rc2) (development) 2025-06-20 09:35:09 +02:00
Filip Pokryvka
e26e965134 release: bump version to 1.55.1 (development) 2025-06-20 09:19:23 +02:00
Beniamino Galvani
dd0ca122e3 ovs: set the tun interface up before stage3
When using the netdev datapath, we wait that the tun link appears, we
call nm_device_set_ip_ifindex() (which also brings the link up) and
then we check that the link is ready, i.e. that udev has announced the
link and the MAC address is correct. After that, we schedule stage3
(ip-config).

In this, there is a race condition that occurs sometimes in NMCI test
ovs_datapath_type_netdev_with_cloned_mac. In rare conditions,
nm_device_set_ip_ifindex() bring the interface up but then ovs-vswitch
changes again the flags of the interface without IFF_UP. The result is
that the interface stays down, breaking communications.

To fix this, we need to always call nm_device_bring_up() after the tun
device is ready. The problem is that we can't do it in
_netdev_tun_link_cb() because that function is already invoked
synchronously from platform code.

Instead, simplify the handling of the netdev datapath. Every
"link-changed" event from platform is handled by
_netdev_tun_link_cb(), which always schedule a delayed function
_netdev_tun_link_cb_in_idle(). This function just assigns the
ip-ifindex to the device if missing, and starts stage3 if the link is
ready. While doing so, it also bring the interface up.

Fixes: 99a6c6eda6 ('ovs, dpdk: fix creating ovs-interface when the ovs-bridge is netdev')

https://issues.redhat.com/browse/RHEL-17358

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2218
(cherry picked from commit 46e0d2b4e4)
2025-06-19 15:12:42 +02:00
Beniamino Galvani
c1d94d7081 connectivity: fix compiler warning when building without concheck
Fix the following:

../src/core/nm-connectivity.c:958:1: warning: ‘check_platform_config’ defined but not used [-Wunused-function]
  958 | check_platform_config(NMConnectivity *self,
      | ^~~~~~~~~~~~~~~~~~~~~

Fixes: 91d447df19 ('device: don't start connectivity check on unconfigured devices')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2224
(cherry picked from commit 1253cbad5a)
2025-06-19 15:12:30 +02:00
Beniamino Galvani
a78f8bbe1b merge: branch 'bg/systemd-fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2223
2025-06-19 15:09:07 +02:00
Beniamino Galvani
9f510533f1 systemd: ignore device_is_devtype()
The function uses symbol sd_device_get_devtype() which is currently
commented out. Therefore, NM dynamically links to the symbol from the
libsystemd shared object, which breaks on machines without systemd.

Before:
$ nm -u build/src/core/NetworkManager | grep sd_device
                 U sd_device_get_sysattr_value@LIBSYSTEMD_240
$

After:
$ nm -u build/src/core/NetworkManager | grep sd_device
$

Fixes: 6a4e6fab40 ('merge: branch 'systemd' into jv/systemd-merge')
2025-06-19 15:08:02 +02:00
Beniamino Galvani
77c99b61c0 Revert "sd-device: use sd_device_get_sysattr_value() to read special symlinks"
Revert systemd commit 6ebbdcc0ddba ("sd-device: use
sd_device_get_sysattr_value() to read special symlinks"). In the NM
codebase sd_device_get_sysattr_value() is currently commented out
because it depends on file chase.c which is not imported. Importing
that file would require another long chain of imports. Therefore,
revert the commit.

This reverts commit 6ebbdcc0ddbacce732001823cf2be2a1d4381c60.

Fixes: 6a4e6fab40 ('merge: branch 'systemd' into jv/systemd-merge')
2025-06-19 15:08:02 +02:00
Beniamino Galvani
fcc5352715 Revert "sd-device: use sd_device_get_sysattr_value() to read uevent file"
Revert systemd commit 17dc9ec4b6e8 ("sd-device: use
sd_device_get_sysattr_value() to read uevent file"). In the NM
codebase sd_device_get_sysattr_value() is currently commented out
because it depends on file chase.c which is not imported. Importing
that file would require another long chain of imports. Therefore,
revert the commit.

This reverts commit 17dc9ec4b6e82fc2a4f9809011e154f538eb8b9c.

Fixes: 6a4e6fab40 ('merge: branch 'systemd' into jv/systemd-merge')
2025-06-19 15:08:02 +02:00
Beniamino Galvani
1253cbad5a connectivity: fix compiler warning when building without concheck
Fix the following:

../src/core/nm-connectivity.c:958:1: warning: ‘check_platform_config’ defined but not used [-Wunused-function]
  958 | check_platform_config(NMConnectivity *self,
      | ^~~~~~~~~~~~~~~~~~~~~

Fixes: 91d447df19 ('device: don't start connectivity check on unconfigured devices')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2224
2025-06-19 15:06:53 +02:00
Íñigo Huguet
1c1f31fdd4 ipv4: remove the forwarding=ignore value
It is not clear whether we can actually respect this value. For example,
we should not restore the kernel's default value on deactivation or
device's state change, but it is unclear if we can ensure that we'll
still have the connection's configuration in all possible changes of
state.

Also, it is unclear if it's a desirable value that we want to support.
At this point it is mostly clear that trying to configure NM managed
devices externally always ends being dissapointing, no matter how hard
we try.

Remove this value for now, while we discuss whether it makes sense or
not, so it doesn't become stable in the new 1.54 release.

(cherry picked from commit 82692cc75c)
2025-06-19 14:28:36 +02:00
Íñigo Huguet
dd7f9fdf8e merge: branch 'ih/rm-forwarding-ignore'
ipv4: remove the forwarding=ignore value

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2221
2025-06-19 12:27:49 +00:00
Íñigo Huguet
82692cc75c ipv4: remove the forwarding=ignore value
It is not clear whether we can actually respect this value. For example,
we should not restore the kernel's default value on deactivation or
device's state change, but it is unclear if we can ensure that we'll
still have the connection's configuration in all possible changes of
state.

Also, it is unclear if it's a desirable value that we want to support.
At this point it is mostly clear that trying to configure NM managed
devices externally always ends being dissapointing, no matter how hard
we try.

Remove this value for now, while we discuss whether it makes sense or
not, so it doesn't become stable in the new 1.54 release.
2025-06-19 12:27:35 +00:00
Beniamino Galvani
a4ee55468f merge: branch 'bg/sriov-preserve-on-down'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2219
https://issues.redhat.com/browse/RHEL-69125
2025-06-18 13:22:35 +02:00
Beniamino Galvani
3588c48686 NEWS: update 2025-06-18 13:21:19 +02:00
Beniamino Galvani
6f219aa649 device: allow reapplying the sriov.preserve-on-down property
It is useful when there is an already active device and we want to
bring it down preserving the SR-IOV VFs. For example:

  $ nmcli connection add type ethernet ifname eni1np1 sriov.total-vfs 2 ipv4.method disabled ipv6.method disabled
  $ nmcli connection up ethernet-eni1np1

  $ ip link show eni1np1
  342: eni1np1: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
      link/ether 6e:cf:f0:08:74:f4 brd ff:ff:ff:ff:ff:ff
      vf 0     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
      vf 1     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...

  $ nmcli device modify eni1np1 sriov.preserve-on-down yes
  $ nmcli connection down ethernet-eni1np1

  $ ip link show eni1np1
  342: eni1np1: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
      link/ether 6e:cf:f0:08:74:f4 brd ff:ff:ff:ff:ff:ff
      vf 0     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
      vf 1     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff, ...
2025-06-18 13:20:49 +02:00
Beniamino Galvani
c70b4a98a3 core: use the sriov.preserve-on-down property 2025-06-18 13:20:49 +02:00
Beniamino Galvani
eb0a22a162 libnm,nmcli: add sriov.preserve-on-down property
Add a new "sriov.preserve-on-down" property that controls whether
NetworkManager preserves the SR-IOV parameters set on the device when
the connection is deactivated, or whether it resets them to their
default value. The SR-IOV parameters are those specified in the
"sriov" setting, like the number of VFs to create, the eswitch
configuration, etc.
2025-06-18 13:20:49 +02:00
Beniamino Galvani
7212d8b8e9 version: add 1.56 macros 2025-06-18 13:20:49 +02:00
Beniamino Galvani
cceec45089 merge: branch 'bg/nmcli-wg-peers'
nmcli: allow setting the wireguard peers

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2220
2025-06-18 09:08:17 +00:00
Beniamino Galvani
b4dde691ec nmcli: add support for managing wireguard peers
Even if WireGuard is supported since long time in NetworkManager, it
is still not possible to manage the list of peers via nmcli. The
reason is that in the past we wanted to introduce a special syntax
that would allow to manage the peer list more easily. However, this
requires heavy changes to the nmcli output formatting code, and so it
never happened.

Since perfection is the enemy of good, abandon the idea of a custom
handling of peers and treat them as any other composite property. The
property is named "wireguard.peers" and exposes the peers indexed by
public key, with optional attributes.

Example:

  $ nmcli connection modify wg0 wireguard.peers "8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o= preshared-key=16uGwZvROnwyNGoW6Z3pvJB5GKbd6ncYROA/FFleLQA= allowed-ips=0.0.0.0/0 persistent-keepalive=10"
  $ nmcli connection modify wg0 +wireguard.peers "fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1:8888"
  $ nmcli -g wireguard.peers connection show wg0
  8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o= allowed-ips=0.0.0.0/0 persistent-keepalive=10, fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1\:8888
  $ nmcli connection modify wg0 -wireguard.peers 8Wgc1a0jJX3rQULwD5NFFLKrKQnbOnTiaNoerLneG1o=
  $ nmcli -g wireguard.peers connection show wg0
  fd2NSxUjkaR/Jft15+gpXU13hKSyZLoe4cp+g+feBCc= allowed-ips=192.168.40.0/24 endpoint=172.25.10.1\:8888
2025-06-16 13:20:02 +02:00
Beniamino Galvani
f13aca1aba NEWS: update 2025-06-16 10:23:25 +02:00
Jan Vaclav
9abe5658cc merge: branch 'jv/systemd-merge'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2213
2025-06-10 09:23:34 +02:00
Beniamino Galvani
46e0d2b4e4 ovs: set the tun interface up before stage3
When using the netdev datapath, we wait that the tun link appears, we
call nm_device_set_ip_ifindex() (which also brings the link up) and
then we check that the link is ready, i.e. that udev has announced the
link and the MAC address is correct. After that, we schedule stage3
(ip-config).

In this, there is a race condition that occurs sometimes in NMCI test
ovs_datapath_type_netdev_with_cloned_mac. In rare conditions,
nm_device_set_ip_ifindex() bring the interface up but then ovs-vswitch
changes again the flags of the interface without IFF_UP. The result is
that the interface stays down, breaking communications.

To fix this, we need to always call nm_device_bring_up() after the tun
device is ready. The problem is that we can't do it in
_netdev_tun_link_cb() because that function is already invoked
synchronously from platform code.

Instead, simplify the handling of the netdev datapath. Every
"link-changed" event from platform is handled by
_netdev_tun_link_cb(), which always schedule a delayed function
_netdev_tun_link_cb_in_idle(). This function just assigns the
ip-ifindex to the device if missing, and starts stage3 if the link is
ready. While doing so, it also bring the interface up.

Fixes: 99a6c6eda6 ('ovs, dpdk: fix creating ovs-interface when the ovs-bridge is netdev')

https://issues.redhat.com/browse/RHEL-17358

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2218
2025-06-06 16:35:12 +02:00
Beniamino Galvani
b678ceab9f merge: branch 'wpa3_transition_fix'
core: fix WPA2 fallback for WPA3 transition APs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2205
2025-06-05 16:15:49 +00:00
Conn O'Griofa
b00c6749d7 core: fix WPA2 fallback for WPA3 transition APs
When connecting to an AP configured for WPA3 transition mode, the
connection will fail if PMF is disabled on the client due to SAE and
FT-SAE being unconditionally added to the key_mgmt variable's
parameters.

By removing the "!is_ap ||" check, SAE and FT-SAE will no longer be
selected when PMF is disabled, allowing clients to connect via
WPA2/PSK mode as per the original intent of
a0988868ba.

Signed-off-by: Conn O'Griofa <connogriofa@gmail.com>
2025-06-05 11:54:16 +00:00
Jan Vaclav
eac9f828e8 tools/nm-in-container: add --skip-unavailable flag for installing debuginfo 2025-06-02 11:08:19 +00:00
Jan Vaclav
4be97207ed tools/nm-in-container: update package install list for fedora 42
- ausearch is part of audit package
- mlocate is not available anymore
- "openvswitch2*" packages are not available anymore
- ipsec-tools is not available anymore
2025-06-02 11:08:19 +00:00
Jan Vaclav
6a4e6fab40 merge: branch 'systemd' into jv/systemd-merge 2025-06-02 10:00:31 +02:00
Íñigo Huguet
b17a842e1a merge: branch 'manpages'
build: make manpages a mandatory part of the build

Closes #1653

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2068
2025-05-30 09:43:14 +00:00
Eli Schwartz
fe62ce6a4b ci: avoid building manpages on Fedora
It appears that xsltproc is not installed there. It is generally needed
for the docs build too, so as a crude CI heuristic, don't build anywhere
that docs are disabled.
2025-05-30 09:42:55 +00:00
Eli Schwartz
a11760ef39 build: make manpages a mandatory part of the build by default
Currently, both man pages and gtk-doc HTML documentation are enabled by
the same build option. It is common for users to want to choose whether
to build HTML docs, as not everyone cares about HTML developer docs, but
manpages are intended directly for end-user consumption and should
always be available. At the very least, there should be a separate
option to disable them to avoid accidentally disabling them while trying
to disable HTML developer docs.

Resolves: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1653
2025-05-30 09:42:55 +00:00
Eli Schwartz
f656675b57 build: install pre-disted manpages if available
When building from a release tarball of NetworkManager,
`meson.add_dist_script()` has copied various prebuilt manpages into the
tarball and building them again is not really necessary. We can just
install those directly.

This means that *all* manpages could be installed even without
introspection, even though some of them can only be *built* when
introspection is enabled.

It also means that manpages can be installed even when xsltproc is not
available at build time.
2025-05-30 09:42:55 +00:00
Eli Schwartz
ee078be745 build: remove outdated, commented-out configure.ac snippet
This was likely added during the port to meson. It's just a multiline
string, so it has no effect in meson, and it appears to be entirely for
things which are already implemented in meson, so there's no real point
in keeping it any longer.
2025-05-30 09:42:55 +00:00
Eli Schwartz
897eed184a build: only demand an xsltproc program when it is used
It's intrinsically used when building manpages, and also part of the
introspection-specific parts of the documentation build. There's no
particular guarantee either of those will actually be invoked during a
build, so don't unconditionally look it up.

This allows building with one fewer dependency in many cases.
2025-05-30 09:42:55 +00:00
Vladimír Beneš
872e626342 release: bump version to 1.55.0 (development) 2025-05-30 11:36:41 +02:00
Vladimír Beneš
20a660110b release: bump version to 1.53.90 (1.54-rc1) 2025-05-30 11:31:37 +02:00
Lubomir Rintel
7ee8d84a1e merge: branch 'lr/ovs-generic'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:46 +02:00
Lubomir Rintel
dcf4bc9241 ovs/factory: fix manager-initiated device creation
The Open VSwitch interfaces have corresponding platform links. When an
Open VSwitch interface is created while NetworkManager is running, the
OVS factory usually sees an OVSDB entry appear first, then creates a
NMDevice. After that, when a platform link appears, the device is
already there.

Upon a (re-)start, the link might be seen first, and then things
go south. The OVS factory rejects the device, which results in Generic
device being created instead. Another device, this time of an
appropriate is created for the same link once the OVSDB entry is seen.

Needless to say, with two NMDevices for the same platform link existing,
no end of mayhem ensues (an assertion is tripped).

Resolves: https://issues.redhat.com/browse/NMT-1634

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:01 +02:00
Lubomir Rintel
f680f23cba manager: note if we see an openvswitch link without a plugin
Add Open VSwitch to link types that are supported by a plugin.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:01 +02:00
Lubomir Rintel
5ef3cfa4d0 ovs/factory: improve logging
Be clearer about the progress of creating the device and ways it can end
up failing.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2207
2025-05-27 11:29:01 +02:00
Beniamino Galvani
4ec06e1eaa merge: branch 'dnsconfd-port-fix'
dns: Fix port handling in Dnsconfd plugin

Closes #1765

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2211
2025-05-27 08:49:59 +00:00
Tomas Korbar
75b3f8496b dns: Fix port handling in Dnsconfd plugin
Fixes #1765
2025-05-27 08:24:22 +00:00
Lubomir Rintel
ccd9431e82 device: update L3 if connectivity changes in IP_CHECK/SECONDARIES
If connectivity goes from/to FULL, the penalization of default route metric
may change. For this reason we re-commit L3 configuration if the
connectivity changes while the device is ACTIVATED.

However, there are more device states that need consideration:
IP_CHECK and SECONDARIES, that happen between initial configuration on
IP_CONFIG and removal when the device goes DEACTIVATING.

This should fix the issue encountered here:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2070

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2212
2025-05-22 11:18:36 +02:00
Florian Schmaus
43bcfbcdf5 cli: drop _NMC_RL_STARTUPHOOK_ARGS
Fixes incompatible pointer types warning, which became an error in
newer compilers (e.g., https://bugs.gentoo.org/938249).

Modern libedit versions use the same type signature as readline for
rl_startup_hook, both declare

typedef int	 rl_hook_func_t(void)

This essentially reverts f47d55fc66 ("cli: Fix for rl_startup_hook
function signatures mismatch (-lreadline vs -ledit)").

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2082
2025-05-20 09:54:31 +02:00
Gris Ge
dd7252ff0c merge: branch 'bg/ip-config-crash'
ip-config: fix crash in DNS options evaluation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2210
2025-05-16 15:36:08 +00:00
Beniamino Galvani
c1350f40bd ip-config: fix crash in DNS options evaluation
Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2025-05-16 09:41:03 +02:00
Beniamino Galvani
fd3eccfb16 device: update the external-down unmanaged flag on port attach/release
A device has the "external-down" unmanaged flag when:

  !is-created-by-nm AND (!is-up OR (!has-address AND !is-controller))

When the "is-up" or the "has-address" conditions change, we properly update
the unmanaged flag by calling _dev_unmanaged_check_external_down() in
_dev_l3_cfg_notify_cb(PLATFORM_CHANGE_ON_IDLE).

The "is-controller" condition changes when another link indicates the
current device as controller. We currently don't update the unmanaged flag
when that happens and so it's possible that the device stays unmanaged even
if it has a port. This can be easily reproduced by running this commands:

    ip link add veth0 type veth peer name veth1
    ip link add vrf0 type vrf table 10
    ip link set vrf0 up
    ip link set veth0 master vrf0

Sometimes, the device shows as "unmanaged" instead of "connected
(externally)".

Fix this by re-evaluating the "external-down" unmanaged flags on the
controller when a port is attached or detached.

Fixes: c3586ce01a ('device: consider a device with slaves configured')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2209
2025-05-15 17:22:39 +02:00
Jan Vaclav
3ae6505d7d systemd: update code from upstream (2025-05-05)
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=a50fa2a40f4a91d49503d3588a3dd29ea05e559b

(
  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-fundamental.h \
                :/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/dhcp-duid-internal.h"
nm_copy_sd_core "src/libsystemd-network/dhcp6-client-internal.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/network-common.c"
nm_copy_sd_core "src/libsystemd-network/network-common.h"
nm_copy_sd_core "src/libsystemd-network/sd-dhcp-duid.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/sd-device/device-internal.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-private.h"
nm_copy_sd_core "src/libsystemd/sd-device/device-util.c"
nm_copy_sd_core "src/libsystemd/sd-device/device-util.h"
nm_copy_sd_core "src/libsystemd/sd-device/sd-device.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-device.h"
nm_copy_sd_core "src/systemd/sd-dhcp-duid.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-dhcp6-protocol.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-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/arphrd-util.h"
nm_copy_sd_shared "src/basic/assert-util.h"
nm_copy_sd_shared "src/basic/bitfield.h"
nm_copy_sd_shared "src/basic/btrfs.c"
nm_copy_sd_shared "src/basic/btrfs.h"
nm_copy_sd_shared "src/basic/cgroup-util.h"
nm_copy_sd_shared "src/basic/chase.h"
nm_copy_sd_shared "src/basic/chattr-util.c"
nm_copy_sd_shared "src/basic/chattr-util.h"
nm_copy_sd_shared "src/basic/constants.h"
nm_copy_sd_shared "src/basic/devnum-util.c"
nm_copy_sd_shared "src/basic/devnum-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-ifname.c"
nm_copy_sd_shared "src/basic/format-ifname.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/glyph-util.c"
nm_copy_sd_shared "src/basic/glyph-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/iovec-util.h"
nm_copy_sd_shared "src/basic/label.c"
nm_copy_sd_shared "src/basic/label.h"
nm_copy_sd_shared "src/basic/list.h"
nm_copy_sd_shared "src/basic/locale-util.c"
nm_copy_sd_shared "src/basic/locale-util.h"
nm_copy_sd_shared "src/basic/lock-util.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_fs.h"
nm_copy_sd_shared "src/basic/missing_pidfd.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_syscall.h"
nm_copy_sd_shared "src/basic/missing_wait.h"
nm_copy_sd_shared "src/basic/mountpoint-util.c"
nm_copy_sd_shared "src/basic/mountpoint-util.h"
nm_copy_sd_shared "src/basic/namespace-util.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/origin-id.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/pidfd-util.c"
nm_copy_sd_shared "src/basic/pidfd-util.h"
nm_copy_sd_shared "src/basic/pidref.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/sha256.c"
nm_copy_sd_shared "src/basic/sha256.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.c"
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/include/net/if.h"
nm_copy_sd_shared "src/basic/include/netinet/in.h"
nm_copy_sd_shared "src/fundamental/assert-fundamental.h"
nm_copy_sd_shared "src/fundamental/iovec-util-fundamental.h"
nm_copy_sd_shared "src/fundamental/logarithm.h"
nm_copy_sd_shared "src/fundamental/macro-fundamental.h"
nm_copy_sd_shared "src/fundamental/memory-util-fundamental.h"
nm_copy_sd_shared "src/fundamental/sha256-fundamental.c"
nm_copy_sd_shared "src/fundamental/sha256-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/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"
nm_copy_sd_stdaux "src/fundamental/unaligned-fundamental.h"
2025-05-14 12:37:33 +02:00
Íñigo Huguet
892e816a9d merge: branch 'ih/unrealized-parents'
core: virtual devices can be available without a parent

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2203
2025-05-14 05:42:36 +00:00
Íñigo Huguet
94595332c4 core: virtual devices can be available without a parent set
When calling to nm_device_is_available, the device types that requires a
parent like VLAN or MACVLAN checks that their parent exists.

nm_device_is_available is a function to check if the device is available
to activate a connection, so it makes sense that if the parent is not
present it can't be activated.

However, this is wrong for 2 reasons:
1. Most of they are virtual devices that might be unrealized when
   checking its availability. If they're unrealized, their parent hasn't
   been set yet.
2. Even if they're realized, their current parent might not be the one
   that is defined in the connection that is being activated.

This is causing that unrealized devices are not being activated as ports
because nm_manager_get_best_device_for_connection thinks that they are
not available.

Get rid of these checks for the parent in the is_available callbacks.

Fixes: ba86c208e0 ('Revert "core: prevent the activation of unavailable OVS interfaces only"')
Fixes: 774badb151 ('core: prevent the activation of unavailable devices')
2025-05-14 05:42:19 +00:00
Íñigo Huguet
34255b2692 merge: branch 'ih/initrd-fix-bond-ip6'
nm-initrd-generator: fix IPv6 with square brackets in bond options

Closes #1755 and #1731

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2197
2025-05-14 05:36:37 +00:00
Íñigo Huguet
6f6bb17a28 nm-initrd-generator: fix ignored prefix for IPv6 address with brackets
When defining an IPv6 address with square brackets and prefix, like
[dead::beef]/64, the prefix was silently ignored. The address was
accepted only accidentally, because get_word replaced ']' with '\0' so
it resulted in a valid IPv6 address string, but without the prefix.

The previous commit has fixed get_word with better logic to handle the
square brackets, uncovering this issue.

Fix it by explicitly splitting IP addresses and prefixes in
reader_parse_ip so we get a valid address and prefix.

Also, use a prefix different to 64 in the test test_if_ip6_manual. 64 is
the default one, making that the test passed despite the defined prefix
was actually ignored.

Fixes: ecc074b2f8 ('initrd: add command line parser')
2025-05-14 07:35:31 +02:00
Íñigo Huguet
aeaf8ca23c nm-initrd-generator: fix IPv6 with square brackets in bond options
If any bond option contains an IPv6 address it needs to be enclosed with
[]. Otherwise the ':' separators from the IP address can be confused
with the ':' separators from the 'bond=' cmdline arguments.

However, the square brackets were ignored:
    $ nm-initrd-generator -s "bond=bond0:eth0,eth1:ns_ip6_target=[FC08::789:1:0:0:3]"
    NetworkManager-Message: 08:46:55.114: <warn>  [1745498815.1146] cmdline-reader: Ignoring invalid bond option: "ns_ip6_target" = "[FC08": '[FC08' is not a valid IPv6 address for 'ns_ip6_target' option
    NetworkManager-Message: 08:46:55.114: <warn>  [1745498815.1148] cmdline-reader: Ignoring extra: '789:1:0:0:3]'.

The opening '[' was only being considered if it was the first character
in `get_word`. Fix it and consider it if it's in the middle too.

If the brackets are used first and last, directly remove them as it is what
most callers expect. However, if it's in the middle there is no reasonable
way to remove them, so don't do it. Instead, the caller will have to consider
this possibility when processing the content.

Fixes: ecc074b2f8 ('initrd: add command line parser')
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1755
2025-05-14 07:35:31 +02:00
Íñigo Huguet
9e585b6cdc merge: branch 'ih/distros-update'
ci: update supported distros

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2202
2025-05-13 13:30:05 +00:00
Íñigo Huguet
bcbe386823 all: code format 2025-05-13 11:43:33 +02:00
Íñigo Huguet
3d1b55047b ci: update supported distros 2025-05-13 11:39:05 +02:00
Wen Liang
26d4bc9d32 merge: branch 'wl/ethtool_fec_backport_symbol'
libnm: add ethtool fec backported symbols from 1.50.4

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2198
2025-05-06 13:35:39 +00:00
Wen Liang
5b25bc4f9d libnm: add ethtool fec backported symbols from 1.46.8
Add to main branch ethtool fec symbols that were backported to 1.46.8 to
allow seamless upgrading from 1.46 to 1.54.
2025-05-06 13:33:30 +00:00
Wen Liang
799a7a432a libnm: add ethtool fec backported symbols from 1.48.18
Add to main branch ethtool fec symbols that were backported to 1.48.18 to
allow seamless upgrading from 1.48 to 1.54.
2025-05-06 13:33:30 +00:00
Wen Liang
6f1437b79e libnm: add ethtool fec backported symbols from 1.50.4
Add to main branch ethtool fec symbols that were backported to 1.50.4 to
allow seamless upgrading from 1.50 to 1.54.
2025-05-06 13:33:30 +00:00
Vladimír Beneš
64a4c2271a
release: bump version to 1.53.4 (development) 2025-05-02 16:46:08 +02:00
Vladimír Beneš
f67ec0ddf4 Revert "release: bump version to 1.53.4 (development)"
This reverts commit 4f849c74b5
2025-05-02 14:43:12 +00:00
Vladimír Beneš
4f849c74b5
release: bump version to 1.53.4 (development) 2025-05-02 16:19:35 +02:00
Beniamino Galvani
d26714481d initrd: fix crash in the NBFT parser
The shared library handle is not initialized when there are no NBFT
entries.

Fixes: 1cb0635d08 ('initrd: add new NBFT parser')
2025-04-30 09:24:50 +02:00
Beniamino Galvani
39b38e5905 merge: branch 'bg/ovs-reapply'
ovs: allow reapplying ovs-bridge and ovs-port properties

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2194
2025-04-29 09:05:49 +00:00
Beniamino Galvani
32ab60f960 device: remove the "can_reapply_change_ovs_external_ids" device field
NMDevices have a special "can_reapply_change_ovs_external_ids" boolean
field indicating whether the device type supports reapplying the
ovs-external-ids and ovs-other-config settings.

Remove this field and use the standard can_reapply_change() method. No
change in behavior is expected.
2025-04-29 11:03:26 +02:00
Beniamino Galvani
4f577d677f ovs: allow reapplying ovs-bridge and ovs-port properties
Allow reapplying the following properties:

 - ovs-bridge.fail-mode
 - ovs-bridge.mcast-snooping-enable
 - ovs-bridge.rstp-enable
 - ovs-bridge.stp-enable
 - ovs-port.bond-downdelay
 - ovs-port.bond-mode
 - ovs-port.bond-updelay
 - ovs-port.lacp
 - ovs-port.tag
 - ovs-port.trunks
 - ovs-port.vlan-mode
2025-04-29 11:03:26 +02:00
Beniamino Galvani
e8e0d43f04 merge: branch 'bg/ovs-bridge-ext-port'
ovs: only keep bridges and ports with NM interfaces attached

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2193
2025-04-29 07:18:27 +00:00
Beniamino Galvani
476c89b6f2 ovs: only keep bridges and ports with NM interfaces attached
If a OVS bridge created via NM has a port created externally, when the
bridge connections goes down then NM detaches the NM-created
port. However, it finds that the bridge still has a port (the external
one) and so it doesn't remove the bridge from ovsdb.

This is a problem, because it means that an explicity deactivation of
the bridge leaves the bridge up. To fix this, only track the number of
port in the bridge actually created by NM. Also, leave alone bridges
not created by NM.
2025-04-29 09:10:52 +02:00
Beniamino Galvani
78a4e5cf3b ovs: slightly improve _delete_interface()
Add comments, and move variables inside the block where they are used.
2025-04-29 09:10:52 +02:00
Beniamino Galvani
0d10c743a5 merge: branch 'nbft-parser-1'
initrd: add new NBFT parser

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2077
2025-04-28 16:44:24 +00:00
Tomas Bzatek
ec917dc670 ci: add libnvme dependency
Required for the nm-initrd-generator NBFT support.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
f0d6b339bf initrd: skip NBFT parsing when already defined on the cmdline
Skip the internal NBFT table parsing when nbft interfaces
are already defined on the cmdline, e.g. from the original
95nvmf dracut module.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
81839c0da8 initrd: workaround zero v6 prefixes for NBFT HFIs
Some firmware implementations incorrectly report v6 address prefix
of zero. Let's use /64 as a sane workaround.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
d38cbfb3d1 initrd: VLAN support for the NBFT parser
Creates additional connections for VLANs, which are in fact
separate HFI records in the NBFT table. Uses MAC address for
linking parent interface as the interface naming is defined
by an external service.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
8b7c6f8b90 initrd: avoid dynamic linking of libnvme, use dlopen() instead
As suggested during the review process, NBFT is niche and most users
won't need it. So keep the initrd generator light and only open
libnvme when any NBFT table is found.

In a typical dracut host-only scenario the nbft dracut module will
be pulled in only when NBFT is present in the system, packing in
nvme-cli and libnvme in the initramfs image.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Tomas Bzatek
1cb0635d08 initrd: add new NBFT parser
The NVMe Boot Firmware Table (NBFT) is a mechanism of passing context
from a pre-OS Boot environment to an OS runtime, as defined by the
NVM Express Boot Specification. Exposed as an ACPI table it contains
network interface definitions along with NVMe subsystem and namespace
data structures.

This adds new nm-initrd-generator parser that uses libnvme NBFT parser
implementation.

Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
2025-04-28 16:09:54 +00:00
Jan Vaclav
03f30ac5cf merge: branch 'jv/po-check'
po: add test to check potfiles list contents

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2190
2025-04-24 10:30:33 +00:00
Jan Vaclav
92c776a88d po: update lists 2025-04-24 10:27:36 +02:00
Jan Vaclav
104be9da87 po: add test to check potfiles list contents
We often forget to add new files to POTFILES, and also
have some paths in the skip file that have not existed
for 15+ years. We should ensure that these files include
the paths that should be there, and nothing more.

This commit adds a test that checks whether all the files
in the po lists exist, and vice versa, that all the files
in the source tree that should be included in this list,
are indeed included in this list.
2025-04-24 10:27:36 +02:00
Beniamino Galvani
e22de07553 merge: branch 'carrier-less-conditions'
device: remove activated condition when the carrier was down

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2189
2025-04-22 16:24:52 +00:00
Friedrich Altheide
c7fc8a4d09 device: remove activated condition when the carrier was down
Call nm_device_update_dynamic_ip_setup every time the carrier was down or was seen down and is now up again, without checking if the state is NM_DEVICE_STATE_ACTIVATED.

Change discussed in https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2173
2025-04-21 19:30:30 +00:00
Beniamino Galvani
87453425ef merge: branch 'dnsconfd_vpn_fix'
dns: Make dnsconfd plugin respect dns-priority

Closes #1748

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2187
2025-04-18 12:32:27 +00:00
Tomas Korbar
e41558e08c dns: Make dnsconfd plugin respect dns-priority
Fixes #1748
2025-04-18 12:14:03 +00:00
Beniamino Galvani
7b2924b762 merge: branch 'bg/ethtool-netlink'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2169
2025-04-17 08:11:54 +02:00
Beniamino Galvani
3fb86182eb README: document the required kernel version
Add a new section in README.md that describes the required Linux
kernel version.
2025-04-17 08:10:54 +02:00
Beniamino Galvani
250475c0fd platform: replace ring ethtool ioctl calls with netlink 2025-04-17 08:10:53 +02:00
Beniamino Galvani
3580dfe517 platform: replace EEE ethtool ioctl calls with netlink 2025-04-17 08:10:51 +02:00
Beniamino Galvani
62c841afcf platform: use the new ethtool-netlink API for pause settings 2025-04-17 08:10:51 +02:00
Beniamino Galvani
79ba228c59 platform: add ethtool netlink implementation
Introduce some basic infrastructure to perform ethtool operations via
netlink. As a proof of concept, implement the pause settings.

Netlink has some advantages over ioctl():

 - it can be easily extended with new attributes;

 - it can return descriptive error messages via the extended ack
   mechanism. For example, when setting the ring parameters to a value
   outside the allowed range, userspace receives error code -EINVAL
   and message "requested ring size exceeds maximum". ioctl() gets
   only -EINVAL, which is shared among many error reasons;

 - since it's possible to specify an ifindex in the request, there are
   no race conditions when the interface name changes;

New ethtool API is available only via netlink; however it makes sense
to start using netlink also for the old API that NM is already using
(pause, eee, rings, etc.) over ioctl() because of the advantages
described above.
2025-04-17 08:10:50 +02:00
Beniamino Galvani
e8a3cd611e platform: move ethtool ioctl functions to a separate file
We're going to replace most of the ioctl-based ethtool functions with
a netlink-based equivalent. Move the ioctl ones to a separate file so
that it's easier to see what still needs to be converted. Also add a
common prefix to the function names.
2025-04-17 08:10:49 +02:00
Beniamino Galvani
88efe48916 libnm-setting: remove unused include 2025-04-17 08:10:49 +02:00
Beniamino Galvani
37785a57e0 platform: use consistent naming for ethtool functions
For unknown reasons (wrong copy and paste?) the getter functions had a
"link" in the name. Remove it.
2025-04-17 08:10:48 +02:00
Íñigo Huguet
a3dd1ef2c7 merge: branch 'ih/fix-ovs-timeout-crash'
core: ovs: fix NULL pointer dereference in ovsdb read timeout callback

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2192
2025-04-16 10:16:02 +00:00
Íñigo Huguet
dc9bf255ee core: ovs: fix NULL pointer dereference in ovsdb read timeout callback
Fixes: f7d321c6d6 ('ovsdb: add watchdog for unparsable JSON data in socket')
2025-04-16 10:15:42 +00:00
Jan Vaclav
b62a0ae7b3 merge: branch 'jv/nmtui-lo'
nmtui: add support for configuring loopback interface

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2175
2025-04-16 07:01:02 +00:00
Jan Vaclav
de56b482f3 nmtui/editor: hide "device" field for loopback connections
This field is irrelevant for this device type, since it will always
be just "lo".
2025-04-15 11:43:06 +00:00
Jan Vaclav
2953200a65 core/devices: generate connections with autoconnect=true
Previously, when a generated connection was edited, and the
machine was rebooted, the connection would not apply, and a
new generated connection would be made, because autoconnect
was set to FALSE.

Set autoconnect to be true by default, so that the modified
generated connection is applied.
2025-04-15 11:43:06 +00:00
Jan Vaclav
f489d213f2 nmtui: add page for configuring loopback interface 2025-04-15 11:43:06 +00:00
Beniamino Galvani
b571e2be5a man: fix syntax to match on connection-id
Fixes: 604c611cd0 ('core: add nm_utils_connection_match_spec_list()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1746
2025-04-15 11:15:02 +02:00
Filip Pokryvka
ec6d122cc9 release: bump version to 1.53.3 (development) 2025-04-14 19:16:15 +02:00
Beniamino Galvani
065fd3e046 merge: branch 'bg/rto-min'
platform: always set the lock flag for RTO_MIN

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2179
2025-04-14 14:43:09 +00:00
Beniamino Galvani
6478e5158a platform: always set the lock flag for RTO_MIN
The rto-min value is ignored by kernel unless the lock flag is set.
2025-04-14 16:41:39 +02:00
Beniamino Galvani
2b922a93a5 platform: accept 0 as valid rto_min value
iproute2 and the kernel accept 0 as valid rto_min value:

  # ip route add 172.16.0.1 dev enp1s0 rto_min 0ms
  # ip route show
  172.16.0.1 dev enp1s0 scope link rto_min lock 0ms

Even if a value of 0ms would not be useful in practice, it is better
to exactly track what kernel reports, instead of assuming that when
the value is zero it is "not set".
2025-04-14 16:41:39 +02:00
Beniamino Galvani
14106431fb libnm-core: set ovs-dpdk and ovs-patch as non-base settings
Settings "ovs-dpdk" and "ovs-patch" are currently marked with priority
NM_SETTING_PRIORITY_HW_BASE, which makes them "base" settings. This
means that they can be used as connection type, for example via "nmcli
connection add type ovs-dpdk ...".

This is wrong, as both settings can only belong to a connection of
type "ovs-interface". Decrease their priority and make them non-base
settings.

The problem was spotted when trying to add a ovs-patch connection via
nmcli:

  # nmcli connection add type ovs-patch ifname p con-name q ovs-patch.peer r controller s port-type ovs-port
  Warning: controller='s' doesn't refer to any existing profile.

  (process:4580): nm-CRITICAL **: 10:15:42.807: file ../src/libnm-core-impl/nm-connection.c: line 1682 (_normalize_ovs_interface_type): should not be reached

  (process:4580): nm-WARNING **: 10:15:42.807: connection did not verify after normalization: ??

  (process:4580): nm-CRITICAL **: 10:15:42.807: file ../src/libnm-core-impl/nm-connection.c: line 2170 (_connection_normalize): should not be reached
  Error: Failed to add 'q' connection: ovs-interface.type: A connection with 'ovs-patch' setting must be of connection.type "ovs-interface" but is "ovs-patch"

Fixes: d0ec501163 ('cli: assert that valid_parts are set for base types')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2178
2025-04-14 13:39:13 +02:00
Beniamino Galvani
37d8945b13 libnm: fix memory leak when parsing IP configuration
When the dictionary contains keys "address" and "uri", the first value
is leaked.

  ==4730== 14 bytes in 1 blocks are definitely lost in loss record 51 of 1,755
  ==4730==    at 0x4841866: malloc (vg_replace_malloc.c:446)
  ==4730==    by 0x4CC5CB9: g_malloc (gmem.c:100)
  ==4730==    by 0x4CDF518: g_strdup (gstrfuncs.c:323)
  ==4730==    by 0x496A6B8: g_strdup_inline (gstrfuncs.h:321)
  ==4730==    by 0x496A6B8: nm_inet_ntop_dup (nm-inet-utils.h:355)
  ==4730==    by 0x496A95B: nm_inet_parse_str (nm-inet-utils.c:539)
  ==4730==    by 0x48AF3A3: _notify_update_prop_nameservers (nm-ip-config.c:179)

Fixes: 4422b14704 ('core, libnm: support per-connection DNS URIs')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2184
2025-04-14 13:36:57 +02:00
Íñigo Huguet
26f2673b90 merge: branch 'ih/nmcli-ovs-port-type'
nmcli: connection: process port-type, type and controller properties first

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2165
2025-04-14 10:08:28 +00:00
Íñigo Huguet
9f6562869b nmcli: improve the warning message about no controller found
When nmcli tries to match a controller it filters by its type. The
controller's type must match with the port's port-type. If no controller
matches, the printed warning was "doesn't refer to any existing
profile". However, the profile might exist, but with wrong type. Improve
the message so it makes that clear.

Fixes: aa12bb353b ('cli: discover slave type for a connection with a master')
2025-04-14 10:08:01 +00:00
Íñigo Huguet
87a5d89f75 nmcli: choose the right port-type for OVS
Normally it is possible not to define port-type in nmcli and it deduces
it from connection.type or connection.controller. Some types like 'bond-slave'
have a single possible value for port-type. In other cases nmcli deduces
the port-type by getting the controller's type, like 'bond'.

For OVS connections, the second method of guessing by the controller's
type was used.  However, in OVS it is common to have different devices
with the same name, causing nmcli to use "ovs-interface" as port-type
if it matched by controller name.

Fix if by deducing the port-type from the connection's type. An ovs-port
connection must always have port-type=ovs-bridge, and an ovs-interface
connection must always have port-type=ovs-port.

Note that this is something that should be done in the daemon, not in
the clients, but this is a small patch that makes it to work in nmcli,
at least. Without this, the mechanism of guessing from the parent would
act, leading to wrong results.

Ideally, all this should be done in the daemon, but currently many
checks in nmcli/libnm depends on having the port-type set, and it
would be lot of work to change it.

Fixes: c5324ed285 ('nmcli: streamline connection addition')
2025-04-14 10:08:01 +00:00
Íñigo Huguet
6a133d10a1 nmcli: connection: don't overwrite port-type if explicitly set
When processing the "type" property we deduce the port-type in some
cases and set it. If the user has chosen a port-type we must not
overwrite it. In any case, we should raise an error when validating the
connection.

Fixes: c5324ed285 ('nmcli: streamline connection addition')
2025-04-14 10:08:01 +00:00
Íñigo Huguet
bb850fda0e nmcli: connection: process port-type, type and controller first
If the connection is a port we need to set the connection.port-type
property. Usually this property is guessed by nmcli depending on the
connection type or the chosen controller, so it doesn't need to be
specified by the user. However, if it is explicitly set by the user
we should not guess, but just use it.

When we process arguments like "controller" or "type" we call custom
functions like set_connection_controller that will guess the port-type
if needed. By processing port-type first, it will be set in the
connection by the time that these other properties are processed, so they
won't try to guess.

After port-type, process connection.type and connection.controller, as we
are usually capable of deducing the port-type from them. Type needs to
be processed first because some types like bond-slave or ovs-port have
only one possible port-type value so we must not try to guess from the
controller.

Fixes: c5324ed285 ('nmcli: streamline connection addition')
2025-04-14 10:08:01 +00:00
Beniamino Galvani
fcf304bbf1 merge: branch 'carrier-down'
device: renew dhcp lease if carrier was down

Closes #1663

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2173
2025-04-14 07:48:44 +00:00
Friedrich Altheide
163c2574d8 device: renew dhcp lease only if carrier was down
Make sure nm_device_update_dynamic_ip_setup is called every time a carrier was down before and the link is now up again.
Previously the dhcp lease was not renewed if the carrier went down and then up again quickly enough.
This led to cases where an old IP was retained even though the device was connected to a different network with a different DHCP server.

This commit introduces device_link_carrier_changed_down

Fixes: d6429d3ddb ('device: ensure DHCP is restarted every time the link goes up')
2025-04-14 07:04:03 +02:00
Lubomir Rintel
fe0b6ad68c merge: branch 'lr/oci-vm-new-conn'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2180
2025-04-11 12:09:49 +02:00
Lubomir Rintel
cb7157f552 test-client: add test for OCI VNIC on VM
Tests that we create a connection for disconnected device.
2025-04-11 11:44:05 +02:00
Lubomir Rintel
c42322bd0d test-client: split up _mock_devices()
The new VM OCI VNIC tests will need to create the devices, but leave one
disconnected.
2025-04-11 11:44:05 +02:00
Lubomir Rintel
39db524d94 test-client: expand MAC addresses from variable
Less literals, more expanded variables. Makes it a little easier to read
for me.
2025-04-11 11:44:05 +02:00
Lubomir Rintel
79b1877c02 test/nm-service: default the devices to DISCONNETED not UNAVAILABLE
It is a little odd that client tests connect "UNAVAILABLE" devices, and
the devices return to "DISCONNECTED" after deactivation.

It differs from what happens in reality, and some client tools
(hey nm-cloud-setup) can break when they rightly assume that the
device is not ready for activation when it's "UNAVAILABLE" not
"DISCONNECTED".
2025-04-11 11:44:05 +02:00
Lubomir Rintel
548e27ef5f cloud-setup: configure disconnected wired devices on OCI
On OCI VMs (virtual machines, as opposed to BM -- bare metal), the VNICs
don't get their addresses via DHCP and need us to get the address from
the metadata and apply it.

https://issues.redhat.com/browse/NMT-1432
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2180
2025-04-11 11:44:05 +02:00
Lubomir Rintel
0540b3c9bc cloud-setup: add a chicken bit variable for creation of new connections
Make it possible to opt in or out of the behavior of creating
connections for disconnected devices. It's not clear why such policy was
in place, and the feature might come useful outside OCI.

Let's add an (undocumented) knob to configure the behavior. We might
remove it (and perhaps make the behaviour default everywhere), or
document and keep it if it turns out we need to use it.
2025-04-11 11:43:28 +02:00
Lubomir Rintel
93960639e8 cloud-setup: factor out creation of new connection
We're going to create connections on wired devices for OCI VM VNICs, and
they're going to also need the same user setting. Factor it out.
2025-04-11 11:43:20 +02:00
Lubomir Rintel
9895540a24 cloud-setup: add device argument to nmcs_add_and_activate()
This will allow us to add & complete connections for existing devices,
such as VNICs on OCI VMs.
2025-04-11 11:43:00 +02:00
Lubomir Rintel
961be7d971 cloud-setup: split up _nmc_skip_connection_by_type()
Split _nmc_skip_connection_by_type() so that we can get a little
more finely grained error reporting.
2025-04-11 11:42:54 +02:00
Íñigo Huguet
95b9b4b678 merge: branch 'ih/coverity'
Fix some defects detected by Coverity

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2174
2025-04-07 14:15:27 +00:00
Íñigo Huguet
9edfc0438c n-dhcp4: fix resource leaks
The function n_dhcp4_c_connection_send_request does not release or take
ownership of its request argument. Because of that, setting it to NULL
in the caller prevents the auto-cleanup of the variable to be executed,
causing a resource leak. Fix it.

Fixes: e23b3c9c3a ('Squashed 'shared/n-dhcp4/' content from commit fb1d43449')
Fixes: 243cc433fb ('n-dhcp4: add new client probe function to send RELEASE message')
2025-04-07 14:15:09 +00:00
Íñigo Huguet
ae7de5b353 core: fix use after free in ping operations
Detected by coverity, the ping_op pointers are used after being freed in
cleanup_ping_operations. Although calling to g_list_remove is probably
safe because it only needs the value of the pointer, not to dereference
it, better to follow best practices. One of the use after free was
actually an error because we dereference ping_op->log_domain.

Fixes: 658aef0fa1 ('connection: Support connection.ip-ping-addresses')
2025-04-07 14:15:09 +00:00
Íñigo Huguet
42edb37499 bond-slb: initialize dest hw address in GARP packets
Detected by Coverity:
    1. NetworkManager-1.53.1/src/core/nm-bond-manager.c:885:5: var_decl: Declaring variable "data" without initializer.
    7. NetworkManager-1.53.1/src/core/nm-bond-manager.c:948:13: uninit_use_in_call: Using uninitialized value "data". Field "data.d_hw_addr" is uninitialized when calling "sendto".
       946|               unaligned_write_ne32(data.s_ip_addr, tmp_addr);
       947|               unaligned_write_ne32(data.d_ip_addr, tmp_addr);
       948|->             if (sendto(sockfd, &data, sizeof(data), 0, (struct sockaddr *) &addr, sizeof(addr)) < 0)
       949|                   return FALSE;
       950|           }

Fixes: 3f2f922dd9 ('bonding: send ARP announcement on bonding-slb link/carrier down')
2025-04-07 14:15:09 +00:00
Lubomir Rintel
cc0222ba01 nmcli/connections: fix build with libedit
This has always been broken (libedit-0:3.1-17.20160618cvs.fc26 is too
old to work and libedit-0:3.1-20.20170329cvs.fc27.x86_64 has this type
mismatch), but new GCC complains (14, 15).

  ../src/nmcli/connections.c: In function ‘nmcli_editor_tab_completion’:
  ../src/nmcli/connections.c:6862:64: error: assignment to ‘void (*)(char **, int,  int)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
   6862 |                             rl_completion_display_matches_hook = uuid_display_hook;
        |                                                                ^
  ../src/nmcli/connections.c:6909:60: error: assignment to ‘void (*)(char **, int,  int)’ from incompatible pointer type ‘void (*)(void)’ [-Wincompatible-pointer-types]
   6909 |                         rl_completion_display_matches_hook = uuid_display_hook;
        |                                                            ^

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2172
2025-04-07 15:27:59 +02:00
Herman Semenov
7ab3f0999f nm-cloud-setup: removed excess validation check fields
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2150
2025-04-07 15:25:49 +02:00
Íñigo Huguet
a4401ae0a6 merge: branch 'ih/fec-uninit-var'
core: fail early if we cannot get current FEC value

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2177
2025-04-07 11:05:25 +00:00
Íñigo Huguet
245f0e0b35 core: optimize hash table search in _ethtool_fec_set
Break the loop as soon as we've found the value.

Fixes: 19bed3121f ('ethtool: support Forward Error Correction(fec)')
2025-04-03 09:44:59 +02:00
Íñigo Huguet
cbdd0d9cca core: fail early if we cannot get current FEC value
If we cannot get current FEC value probably we won't be able to set it a
few lines later. Also, if it fails to set, we try to use the value of
the old one that we tried to retrieve without success. In that case, the
variable old_fec_mode would be uninitialized. Fix it by returning early
if we cannot get the current value.

Fixes: 19bed3121f ('ethtool: support Forward Error Correction(fec)')
2025-04-03 09:44:54 +02:00
Beniamino Galvani
355edef8b5 merge: branch 'bg/prefix-delegation'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2162
2025-04-02 17:05:57 +02:00
Beniamino Galvani
b6386b3d27 core: support prefix-delegation.subnet-id 2025-04-02 11:21:59 +02:00
Beniamino Galvani
b372caf0c4 libnm, nmcli: introduce new "prefix-delegation" setting
Introduce a new "prefix-delegation" setting. It contains properties
related to the configuration of downstream interfaces using IPv6
prefix-delegation. The only property at the moment is "subnet-id",
which specifies which prefix to choose when the delegation contains
multiple /64 networks.
2025-04-02 11:21:59 +02:00
Beniamino Galvani
4a8bedcd89 device: remove the prefix-delegation IP configuration on cleanup
When a device in IPv6 shared mode obtains a prefix, it adds a new l3cd
of type L3_CONFIG_DATA_TYPE_PD_6 for that prefix. However, that l3cd
is never removed later and so the address lingers on the interface
even after the connection goes down. Remove the l3cd on cleanup.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
037b14965e libnmc-setting: add new flag for property descriptors
Add a new flag "print_hex_negative_as_base10" in the property
descriptor _NMMetaPropertyTypData.

Normally, when a property has "base = 16", it is printed as unsigned
even if the gtype is signed.

For some properties, we want to print the hexadecimal representation
for positive values, and the base10 representation with minus sign for
negative values. A typical use case is to encode the default value as
"-1" and use positive values as a hexadecimal number.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
dbc4ff0a1d libnm-glib-aux: add nm_ip6_addr_get_subnet_id()
Add function nm_ip6_addr_get_subnet_id() to get the subnet ID of a
IPv6 address.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
4ed1d04aff libnm-glib-aux: add nm_puint64_hash()/nm_puint64_equal()
The two new functions can be used as GHashFunc and GEqualFunc when
creating hash tables whose keys are pointers to a guint64.
2025-04-02 11:18:02 +02:00
Beniamino Galvani
0e4330f2b4 ovs: introduce new "ovs-dpdk.lsc-interrupt" property
Introduce a new "ovs-dpdk.lsc-interrupt", used to configure the Link
State Change (LSC) detection mode.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2149
2025-04-02 11:13:31 +02:00
Beniamino Galvani
4b572a1a4a device: forget about carrier deferred action when ifindex changes
When the carrier of an interface goes down, we defer the handling of
that event by some time (by default 6 seconds), to detect if the
carrier change was a spurious event.

It was observed that in some conditions the carrier goes down and we
register the timer for the deferred action on the device. Then the
link is deleted and recreated. At this point the timer fires and
aborts the new activation of the device.

Once the ifindex changes, cancel the timer for the deferred
carrier-down action.
2025-04-02 10:01:38 +02:00
Beniamino Galvani
ba86c208e0 Revert "core: prevent the activation of unavailable OVS interfaces only"
This was a workaround until the real cause of the issue was found.

This reverts commit a1c05d2ce6.
2025-04-02 10:01:38 +02:00
Wen Liang
40ddff9cc9 merge: branch 'wl/per_iface_ip_forward'
ip-config: Support configuring per-device IPv4 sysctl forwarding option

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2071
2025-04-01 13:43:11 +00:00
Wen Liang
2ad5fbf025 policy: refresh IPv4 forwarding after connection activation and disconnection
Previously, IPv4 shared method will automatically enable the IPv4
global forwarding, all the per-interface level IPv4 forwarding settings
may be changed to match the global setting. Also, all the per-inteface
level forwarding settings can not be restored when deactivating the
shared connection. This is problematic as it may disrupt custom
configurations and lead to inconsistent forwarding behavior across
different network interfaces.

To address this, the implementation now ensures that the original
per-interface forwarding settings are preserved. Upon activating a
shared connection, instead of enabling IPv4 global forwarding
automatically, the per-interface forwarding is enabled on all other
connections unless a connection explicitly has the forwarding set to
"no" in its configuration. Upon deactivating all shared connection,
per-interface forwarding settings are restored to sysctl's default
value. Furthermore, deactivating any connection explicitly sets the
forwarding to sysctl's default value ensuring that network forwarding
behavior remains consistent.
2025-04-01 09:32:46 -04:00
Wen Liang
a8a2e6d727 ip-config: Support configuring per-device IPv4 sysctl forwarding option
Add support for configuring per-interface IPv4 sysctl forwarding setting
in NetworkManager. The feature allows users to configure the
net.ipv4.conf.<interface>.forward setting directly through
NetworkManager, enabling targeted forwarding configurations for
interfaces. This is particularly useful for cases such as enabling
forwarding for MetalLB load balancing without requiring a global
ip_forward=1 setting.

While forwarding setting can be managed via /etc/sysctl.conf,
configuring sysctl options for dynamically created or
software-configured interfaces (e.g., bridges) poses challenges. With
this feature, NetworkManager can configure these settings when
interfaces are created or updated, users no longer need to rely on
nm-dispatcher scripts for per-interface sysctl configuration, which can
be error-prone and complex. This feature ensures a more seamless and
integrated way to manage per-interface forwarding configurations,
reducing user overhead and improving usability in complex network
setups.

We do not support configuring per-device IPv6 sysctl forwarding because
in order to make per-device IPv6 sysctl forwarding work, we also need to
enable the IPv6 global sysctl forwarding setting, but this has potential
security concerns because it changes the behavior of the system to
function as a router, which expose the system to new risks and
unintended traffic flows, especially when enabling forwarding on the
interface the user previously explicitly disabled. Also enabling
per-device IPv6 sysctl setting will change the behavior of router
advertisement (accept_ra), which is not expected. Therefore, we
only support configuring per-device IPv4 sysctl forwarding option in
NetworkManager.

Resolves: https://issues.redhat.com/browse/RHEL-60237
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2071
https://gitlab.freedesktop.org/NetworkManager/NetworkManager-ci/-/merge_requests/1833
2025-04-01 09:32:46 -04:00
Jan Vaclav
5e17b52810 merge: branch 'jv/wg-nftables'
wireguard: add connmark and filtering firewall rules

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2158
2025-04-01 08:09:17 +00:00
Jan Vaclav
2106251e46 firewall/utils: replace ipv4 iptables macro with ipxtables macro 2025-04-01 08:08:52 +00:00
Jan Vaclav
18d5b7d641 firewall/utils: remove _share prefix from iptables_get_name
It's no longer used just for shared mode.
2025-04-01 08:08:52 +00:00
Jan Vaclav
a769c17af7 firewall/wireguard: drop packets received to wrong interface
If we receive a packet sent to the WG interface's address,
but it does not come from the WG tunnel, let's assume something
is broken and drop the packet.

This is also inspired by wg-quick firewall rules:
https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash?id=17c78d31c27a3c311a2ff42a881057753c6ef2a4#n221
2025-04-01 08:08:52 +00:00
Jan Vaclav
db557908a2 wireguard: add firewall rules to copy mark
When a WG connection is connecting to an IPv6 endpoint, configures a
default route, and firewalld is active with IPv6_rpfilter=yes, it never
handshakes and doesn't pass traffic. This is because firewalld has a
IPv6 reverse path filter which is discarding these packets.

Thus, we add some firewall rules whenever a WG connection is brought up
that ensure the conntrack mark and packet mark are copied over.
These rules are largely inspired by wg-quick:

https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash?id=17c78d31c27a3c311a2ff42a881057753c6ef2a4#n221
2025-04-01 08:08:52 +00:00
Jan Vaclav
0f469b30ad build: add path definition for ip6tables 2025-04-01 08:08:52 +00:00
Jan Vaclav
10c2892d57 firewall/utils: move logs from sharing to firewall domain 2025-04-01 08:08:52 +00:00
Jan Vaclav
e39e119636 firewall/utils: fix ntf -> nft typo
Fixes: 4badc1f33a ('firewall: fix signalling timeout error reason from _fw_nft_call()')
2025-04-01 08:08:52 +00:00
Herman Semenov
3aa6e689ec libnm-platform: fix not set MACVTAP when cache ops added or updated
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2151
2025-03-31 14:58:45 +02:00
Beniamino Galvani
7f381c9d68 merge: branch 'wip/jtojnar/pygobject-3.52-docs'
meson: Fix docs generation with PyGObject 3.52

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2164
2025-03-31 12:08:38 +00:00
Jan Tojnar
12eff9a7fd meson: Fix docs generation with PyGObject 3.52
PyGObject 3.52 switched from gobject-introspection’s libgirepository 1.0
to glib’s libgirepository 2.0. As a result, the Python script would
no longer be able to find the `GIRepository` 2.0 typelib:

    (process:1944): GLib-GIRepository-DEBUG: 15:25:14.521: Ignoring GIRepository-2.0.typelib because this libgirepository corresponds to GIRepository-3.0.typelib

We could update the script to support both versions of the typelib
but it is not really necessary. It was only used to add extra directories
from `$LD_LIBRARY_PATH` and the CLI argument to repository’s library path
but libgirepository already supports using `LD_LIBRARY_PATH` directly:
https://docs.gtk.org/girepository/method.Repository.prepend_library_path.html
2025-03-31 12:04:43 +00:00
Beniamino Galvani
ecce8fa461 vpn: fix logging message
Fixes: c4a7d6a06f ('vpn: honor the ipvX.method connection property')
2025-03-31 13:39:07 +02:00
Beniamino Galvani
ba0474ef06 merge: branch 'pr/2147'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2147
2025-03-31 10:02:43 +02:00
Michael Biebl
b5c81a9070 Regenerate files so it matches the expected output 2025-03-27 14:52:00 +01:00
Michael Biebl
0e83c595f3 Rephrase certain expressions to avoid the usage of the term "allows to" 2025-03-27 09:44:07 +01:00
Michael Biebl
898db303c3 typo fix: allow to -> allow one to
Detected by lintian:

Example:
I: network-manager: typo-in-manual-page "allow to" "allow one to" [usr/share/man/man5/NetworkManager.conf.5.gz:1392]
2025-03-26 19:22:56 +01:00
Michael Biebl
10e58f7c3c typo fix: allows to -> allows one to
Detected by lintian:

Example:
I: network-manager: typo-in-manual-page "allows to" "allows one to" [usr/share/man/man5/NetworkManager.conf.5.gz:1266]
2025-03-26 19:22:01 +01:00
Michael Biebl
a98d85af93 typo fix: succesfully -> successfully
Detected by lintian:
I: network-manager: spelling-error-in-binary succesfully successfully [usr/sbin/NetworkManager]
2025-03-26 18:38:56 +01:00
Beniamino Galvani
5ed963e054 build: remove -flto-partition=none when building with GCC
Older versions of GCC (< 12) have issues building NM with LTO because
they drop libnm symbols added via '_asm__(".symver " ...)', which we
use to support symbols backported to older versions of the DSO.

Nowadays, GCC supports a new "__symver__" attribute that is
LTO-friendly; use that when possible and remove the
-flto-partition=none hack, as it increases memory usage when
compiling.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1714
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2142
2025-03-26 09:25:53 +01:00
Beniamino Galvani
481afec6ea release: fix validation of gitlab token
If the token is wrong or expired, the command still returns
success. Check the content of the reply instead.

Fixes: f05192ada8 ('release.sh: release to freedesktop.org, not to GNOME')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2148
2025-03-25 14:35:55 +01:00
Beniamino Galvani
ea0be49451 merge: branch 'bg/secret-agent-gi'
examples: add secret agent example in python/gi

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2166
2025-03-25 13:34:33 +00:00
Beniamino Galvani
eb24d7cf03 examples: add secret agent example in python/gi
Add an example of a simple secret agent written in Python using
GObject introspection.
2025-03-25 14:32:27 +01:00
Beniamino Galvani
c01168f4f9 libnm: fix GObject introspection annotations for NMSecretAgentOld
Add some missing "(nullable)" annotations to parameters of the
callback functions in NMSecretAgentOld. Otherwise, PyGObject complains
that those parameters cannot be NULL when implementing a secret agent.

Fixes: d595f7843e ('libnm: add libnm/libnm-core (part 1)')
2025-03-25 14:31:26 +01:00
Piotr Drąg
e51de3750e po: Update POTFILES.in and POTFILES.skip
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2154
2025-03-25 11:19:14 +01:00
Íñigo Huguet
050f4e6500 merge: branch 'ih/sl-po'
po: Update Slovenian (sl) po file

Closes #1716

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2156
2025-03-24 14:35:54 +00:00
Íñigo Huguet
b68d25af9b po: Update Slovenian (sl) po file
Contributed-by: @filmsi (https://gitlab.freedesktop.org/filmsi)
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1716
2025-03-24 14:32:04 +00:00
Íñigo Huguet
23e42cb73a merge: branch 'ih/fix-lacp-msg'
bond: fix wrong property name in error message

Closes #1720

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2157
2025-03-24 14:31:46 +00:00
Íñigo Huguet
95de3bee86 bond: fix wrong property name in error message
Contributed-by: Jiří Boháč (https://gitlab.freedesktop.org/jbohac)
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1720
2025-03-24 14:30:51 +00:00
Íñigo Huguet
45e7e158c1 merge: branch 'ih/nmcli-complete'
nmcli: fix argument completion if nmcli is aliased

Closes #1734

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2159
2025-03-24 14:29:42 +00:00
Íñigo Huguet
78f179b53e nmcli: fix argument completion if nmcli is aliased
If an alias like `nmcli=nmcli --some-arguments` is used, bash completion
doesn't work. Fix it by using `command nmcli` from the nmcli-completion
script, so we ensure that the --complete-args is passed directly to
nmcli binary, not through an alias.

Contributed-by: Jonas Belouadi (@potamides)
Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1734
2025-03-24 14:29:19 +00:00
Íñigo Huguet
8b8fc44b19 merge: branch 'ih/macvlan-promisc'
libnm: macvlan: specify that promiscuous affects to the parent

Closes #1732

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2160
2025-03-24 14:18:41 +00:00
Íñigo Huguet
1fdcfb7abe libnm: macvlan: specify that promiscuous affects to the parent
Fixes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1732
Fixes: 4d0192e661 ('libnm-core: add NMSettingMacvlan')
2025-03-24 15:16:04 +01:00
Vladimír Beneš
0d76bec4de release: bump version to 1.53.2 (development) 2025-03-24 11:26:04 +01:00
Beniamino Galvani
a0ff8d20f0 merge: branch 'dnsconfd_plugin_fixes'
dns: Fix invalid memory access on Dnsconfd DBUS error

Closes #1738

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2161
2025-03-24 08:14:50 +00:00
Tomas Korbar
7ba27f7a13 dns: Refactor changing of Dnsconfd plugin state 2025-03-24 07:56:26 +00:00
Tomas Korbar
4ad20787bb dns: Fix invalid memory access on Dnsconfd DBUS error
DBus errors were not properly handled after DBus calls and
that caused SIGSEGV. Now they are checked.

Fixes #1738
Fixes: b8714e86e4 ('dns: introduce configuration_serial support to the dnsconfd plugin')
2025-03-24 07:56:26 +00:00
Íñigo Huguet
42349205dd merge: branch 'ff/makerepo_f40'
contrib/makerepo.sh: fix script for fedpkg 1.44

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2124
2025-03-12 09:17:05 +00:00
Fernando Fernandez Mancera
b281ae0c22 contrib/makerepo.sh: fix script for fedpkg 1.44
If the user of the script still uses fedpkg 1.44 the script fails
because the -build directory doesn't exist.

Now it was tested in both versions.
2025-03-12 09:16:50 +00:00
Jan Vaclav
63b81d893e merge: branch 'jv/accept-localhost-persistent'
policy: accept localhost hostnames if statically configured

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2114
2025-03-12 09:00:56 +00:00
Jan Vaclav
152d71a1f1 policy: accept localhost hostnames if static
Prevents NetworkManager from trying to determine the
transient hostname via DHCP or other means if "localhost"
is already configured as a static hostname, as the transient
hostname will be ignored by hostnamed if a static hostname
has already been set.
2025-03-11 09:26:20 +00:00
Jan Vaclav
21c46d6e5f libnm-glib-aux: add nm_utils_is_not_empty_hostname
Checks whether the hostname is not empty or "(none)".
2025-03-11 09:26:20 +00:00
Beniamino Galvani
6292b0c9dc version: add version 1.54 macros 2025-03-06 18:45:23 +01:00
Íñigo Huguet
dc51ffe857 NEWS: update the 1.52 to match nm-1-52 2025-03-04 08:49:18 +01:00
Íñigo Huguet
a60ca31fd9 spec: specify paths to *-initrd.service files from the buildroot
Fixes: 91e36ea214 ('spec: don't install *-initrd.services')
2025-03-04 07:19:56 +01:00
Íñigo Huguet
91e36ea214 spec: don't install *-initrd.services
They cannot be used yet as Dracut need changes. They are not really
tested, neither, so better not to install them as they might cause
confusion about their purpose.
2025-03-03 15:42:36 +01:00
Íñigo Huguet
bf1a8ce5d4 release: bump version to 1.53.1 (development) 2025-02-28 15:45:29 +01:00
Íñigo Huguet
90c403f4ef contrib/build: ignore missing signingkey in git config
Fixes: 64f8ec6099 ('rpm/build*.sh: trap failures')
2025-02-28 14:33:18 +01:00
Lubomir Rintel
4a8e672506 merge: branch 'lr/sw-device-cleanup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2126
2025-02-26 11:06:13 +01:00
Lubomir Rintel
70872cbb38 Reapply "client/test: add test for VLANs on OCI"
This reverts commit a852b79cf5.
2025-02-26 11:05:19 +01:00
Lubomir Rintel
7eee669217 Reapply "cloud-setup: create VLANs for multiple VNICs on OCI"
The idea is to create a pair of VLAN and MACVLAN with AddAndActivate if
they are not present, and otherwise follow the ordinary (GetApplied &
Reapply) procedure if the devices are already present.

This reverts commit 87d7ccc580.
2025-02-26 11:05:19 +01:00
Lubomir Rintel
6cedd594b6 Reapply "cloud-setup: lookup device by MAC + type instead of just MAC"
This will be useful for updating configuration of Vlans and MacVlans,
some of having same MAC addresses as devices of other type.

This reverts commit cee0515f13.
2025-02-26 11:05:19 +01:00
Lubomir Rintel
5c3efeef15 Reapply "cloud-setup: parse OCI metadata related to VLAN config"
Baremetal instances in Oracle Cloud require special VLAN config. Parse
the metadata related to it.

This reverts commit 5eefd2d59c.
2025-02-26 11:05:08 +01:00
Lubomir Rintel
11045cfa00 Reapply "manager: create virtual devices on AddAndActivate()"
This reverts commit ccae5dc0e2.
2025-02-26 11:05:08 +01:00
Lubomir Rintel
45d82f720c manager: make system_create_virtual_device() return a GError
This is done so that AddAndActivate() will return sensible errors in a
future patch that makes it support creating virtual devices.

In effect, all errors are logged in one place, therefore the log levels
are different. I don't think we're losing anything of value by being
a little less verbose here.
2025-02-26 11:05:08 +01:00
Beniamino Galvani
1b4372a9be merge: branch 'initrd-services'
systemd: add initrd-specific services

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2089
2025-02-26 09:32:30 +00:00
Antonio Alvarez Feijoo
8640ea822f systemd: add initrd-specific services
Decouple from a specific initrd generator (dracut) the systemd services that
provide networking in the initrd using NM, thus allowing other systemd-based
initrd generators to take advantage of it.

These new services are:
- `NetworkManager-config-initrd.service`: it starts very early at boot, parses
the kernel command line using `nm-initrd-generator` and sets the
`/run/NetworkManager/initrd/neednet` flag to activate the other initrd services,
and also sets the hostname if needed.
- `NetworkManager-initrd.service`: it basically does the same job as the
`NetworkManager.service`, but in the initrd.
- `NetworkManager-wait-online-initrd.service`: ordered before
`network-online.target`, it will allow other services that require networking to
delay their start until NM has finished.
2025-02-26 09:31:05 +00:00
Íñigo Huguet
a90efe91ad merge: branch 'lr/skip-broken'
Various CI/build fixes

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2135
2025-02-25 09:55:08 +00:00
Lubomir Rintel
cafb841a29 CI: update images 2025-02-25 09:38:49 +00:00
Lubomir Rintel
979717df4e gitlab/fedora-install: use yum install --allowerasing
This allows us to drag in packages that replace something in the base
image. Notably, this fixes installing pppd on Fedora 42 that requires
systemd (whereas the image has conflicting systemd-standalone-sysusers).
2025-02-25 09:38:49 +00:00
Lubomir Rintel
39efc8a394 fedora/REQUIRED_PACKAGES: remove very old optional package names
Attempting to install these takes time and they are no longer there
since ancient times. CentOS 9 and later are fine.
2025-02-25 09:38:49 +00:00
Lubomir Rintel
e2aa19a06c Revert "fedora/REQUIRED_PACKAGES: speed up optional packages installation"
dnf --skip-unavailable not available on CentOS 9.

This reverts commit 5409d4f5cd.
2025-02-25 09:38:49 +00:00
Lubomir Rintel
054962aeea contrib: drop old gtkdoc patch
This has been integrated 6 years ago.
2025-02-25 09:38:49 +00:00
Lubomir Rintel
aea231f489 contrib/build: ignore initial failure to set $SOURCE
More fallout from set -e patch, encountered during a release.

Fixes: 64f8ec6099 ('rpm/build*.sh: trap failures')
2025-02-25 09:38:49 +00:00
Íñigo Huguet
8f2f86e0f0 merge: branch 'main'
po: Update Georgian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2140
2025-02-25 09:36:25 +00:00
NorwayFun
af8b74ab2a po: Update Georgian translation 2025-02-25 09:35:54 +00:00
Íñigo Huguet
26a5eb0d98 merge: branch 'bg/check-domain-utf8'
core: discard non UTF-8 search domains

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2145
2025-02-25 09:29:30 +00:00
Beniamino Galvani
14a521ac9b core: discard non UTF-8 search domains
Domains are exported via D-Bus and so they must be valid UTF-8.

RFC 1035 specifies that domain labels can contain any 8 bit values,
but also recommends that they follow the "preferred syntax" which only
allows letters, digits and hypens.

Don't introduce a strict validation of the preferred syntax, but at
least discard non UTF-8 search domains, as they will cause assertion
failures later when they are sent over D-Bus.
2025-02-25 09:29:05 +00:00
Beniamino Galvani
472a7b48e8 merge: branch 'bg/mptcp-endpoints'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2141
2025-02-24 08:56:27 +01:00
Beniamino Galvani
227cd6307b l3cfg: only add MPTCP endpoints for non-tentative IPv6 addresses
An IPv6 endpoint is not usable until the address is non-tentative. Add
a mechanism to wait until the address is ready.
2025-02-24 08:55:53 +01:00
Beniamino Galvani
6bf859af79 l3cfg: wait for the address before configuring an MPTCP endpoint
Skip the configuration of the MPTCP endpoint when the address is in
the l3cd but is not yet configured in the platform. This typically
happens when IPv4 DAD is enabled and the address is being probed.

If we configure the endpoint without the address set, the kernel will
try to use the endpoint immediately but it will fail. Then, the
endpoint will not be used ever again after the address is added.
2025-02-24 08:55:53 +01:00
Beniamino Galvani
b6e67c6abc core: split nm_netns_watcher_remove_all()
The name suggests that the function always removes all the watchers
with the given tag; instead it removes only "dirty" ones when the
"all" parameter is FALSE. Split the function in two variants.
2025-02-24 08:55:53 +01:00
Lubomir Rintel
a7cf9d399f keyfile: don't crash on failure to write
The log statement ended up using wrong (always NULL) connection to get
ID from. Fix.

Resolves: https://issues.redhat.com/browse/RHEL-77157
2025-02-24 06:52:35 +01:00
Beniamino Galvani
2ee54e66c3 merge: branch 'dnsconfd_autostart_fix'
Fix Dnsconfd autostart

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2144
2025-02-20 18:01:39 +00:00
Tomas Korbar
1463b1c0a3 dns: fix Dnsconfd autostart
When Dnsconfd service is enabled but not started, NetworkManager
should attempt to start it through DBus at least once.

Fixes: c6e1925dec ('dns: Add dnsconfd DNS plugin')
2025-02-20 17:55:41 +00:00
Beniamino Galvani
5aafbb9bf8 NEWS: update for 1.54 (development) 2025-02-20 14:15:28 +01:00
Jan Vaclav
4f6a057a09 nmcli: print to stderr where appropriate
Currently, nmcli logs a lot of error messages to stdout rather
than stderr. Make it so that stderr is used whenever it makes
sense.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2108
2025-02-20 09:13:01 +00:00
Íñigo Huguet
462b4172b2 merge: branch 'ih/autocon_ports_uninit'
policy: fix unitialized variable

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2143
2025-02-20 06:42:20 +00:00
Íñigo Huguet
af6aca3527 policy: fix unitialized variable
The variable 'change' may be used uninitialized.

Fixes: 7acc66699a ('policy: always reset retries when unblocking children or ports')
2025-02-20 06:41:50 +00:00
Kyle Ouellette
42b95fad79 ndisc: ignore IPv6 RA PIOs if preferred lifetime > valid lifetime
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2117
2025-02-18 15:56:04 +01:00
Jan Vaclav
e983e8a46f nmtui/ipv6: add "shared" method to ipv6 options
It was previously only available for IPv4, and the option
was missing from the IPv6 methods.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2138
2025-02-18 12:09:03 +01:00
Fernando Fernandez Mancera
077ffcc0ea policy: unify logs formatting to use NM_HASH_OBFUSCATE_PTR
Having these hashes around are really useful when debugging issues. In
nm-policy we were using the pointer directly which is wrong as they are
not used in other places.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2133
2025-02-18 12:01:17 +01:00
Fernando Fernandez Mancera
a1c05d2ce6 core: prevent the activation of unavailable OVS interfaces only
Preventing the activation of unavailable devices for all device types is
too aggresive and leads to race conditions, e.g when a non-virtual bond
port gets a carrier, preventing the device to be a good candidate for
the connection.

Instead, enforce this check only on OVS interfaces as NetworkManager
just makes sure that ovsdb->ready is set to TRUE.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2139

Fixes: 774badb151 ('core: prevent the activation of unavailable devices')
2025-02-18 11:54:57 +01:00
Beniamino Galvani
006a3fb51a merge: branch 'bg/dnsconfd-fix-pending'
Some fixes for the dnsconfd plugin

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2137
2025-02-13 09:37:24 +00:00
Beniamino Galvani
4d84e6cddf dnsconfd: drop "connection-*" entries from the update method
Stop passing "connection-*" entries in the update method to
dnsconfd. The plugin tries to determine the connection from the
ifindex, but it's not possible to do it right at the moment because
the same ifindex can be used at the same time e.g. by a policy-based
VPN like ipsec and a normal device. Instead, it should be NM that
explicitly passes the information about the connection to the DNS
plugin. Anyway, these variables are not used at the moment by
dnsconfd.

Fixes: c6e1925dec ('dns: Add dnsconfd DNS plugin')
2025-02-13 10:36:08 +01:00
Beniamino Galvani
2bfd27f74d dnsconfd: set the state to idle when connection fails
If the plugin can't connect to D-Bus, it is not waiting for an update;
set the state to idle.
2025-02-13 10:36:08 +01:00
Beniamino Galvani
8ff1cbf38b dnsconfd: fix handling of the update-pending flag
After every state change of the plugin there should be an invocation
of _nm_dns_plugin_update_pending_maybe_changed() to re-evaluate
whether we are waiting for an update. send_dnsconfd_update() doesn't
change the state and so there is need to check again afterwards.
2025-02-13 10:36:08 +01:00
Fernando Fernandez Mancera
7acc66699a policy: always reset retries when unblocking children or ports
When calling activate_port_or_children_connections() we are unblocking
the ports and children but we are not resetting the number of retries if
it is an internal activation.

This is wrong as even if it's an internal activation the number of
retries should be reset. It won't interferfe with other blocking reasons
like USER_REQUESTED or MISSING_SECRETS.
2025-02-12 16:26:50 +01:00
Filip Pokryvka
b2f7f3950d release: bump version to 1.53.0 (development) 2025-02-12 13:31:51 +01:00
424 changed files with 33115 additions and 21824 deletions

4
.gitignore vendored
View file

@ -81,9 +81,11 @@ test-*.trs
/data/org.freedesktop.NetworkManager.service
/data/server.conf
/data/org.freedesktop.NetworkManager.policy
/data/org.freedesktop.NetworkManager.policy.in
/data/nm-sudo.service
/data/nm-priv-helper.service
/data/NetworkManager-config-initrd.service
/data/NetworkManager-initrd.service
/data/NetworkManager-wait-online-initrd.service
/docs/api/version.xml
/docs/api/settings-spec.html

View file

@ -60,11 +60,11 @@ variables:
#
# This is done by running `ci-fairy generate-template` and possibly bumping
# ".default_tag".
ALPINE_TAG: 'tag-672dcdb2e2bf'
CENTOS_TAG: 'tag-d7d348d344cf'
DEBIAN_TAG: 'tag-217545cfdeb1'
FEDORA_TAG: 'tag-d7d348d344cf'
UBUNTU_TAG: 'tag-217545cfdeb1'
ALPINE_TAG: 'tag-0c3a6f855fb8'
CENTOS_TAG: 'tag-c1c23df75dda'
DEBIAN_TAG: 'tag-d4bf5db9e214'
FEDORA_TAG: 'tag-c1c23df75dda'
UBUNTU_TAG: 'tag-d4bf5db9e214'
ALPINE_EXEC: 'bash .gitlab-ci/alpine-install.sh'
CENTOS_EXEC: 'bash .gitlab-ci/fedora-install.sh'
@ -114,13 +114,55 @@ tier1:fedora:42@prep:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule' || $SCHEDULED_PIPELINE_NAME == "weekly"
tier2:ubuntu:25.04@prep:
tier2:fedora:rawhide@prep:
extends:
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'rawhide'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:centos:stream10@prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream10'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:centos:stream9@prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:ubuntu:devel@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '25.04'
FDO_DISTRIBUTION_VERSION: 'devel'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
@ -128,13 +170,13 @@ tier2:ubuntu:25.04@prep:
when: manual
allow_failure: true
tier2:debian:13@prep:
tier2:debian:testing@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '13'
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
@ -142,13 +184,27 @@ tier2:debian:13@prep:
when: manual
allow_failure: true
tier2:alpine:3.22@prep:
tier2:debian:sid@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier2:alpine:edge@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.22'
FDO_DISTRIBUTION_VERSION: 'edge'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
@ -156,6 +212,20 @@ tier2:alpine:3.22@prep:
when: manual
allow_failure: true
tier3:fedora:43@prep:
extends:
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '43'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
FDO_DISTRIBUTION_EXEC: $FEDORA_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:fedora:41@prep:
extends:
- .fdo.container-build@fedora
@ -170,6 +240,20 @@ tier3:fedora:41@prep:
when: manual
allow_failure: true
tier3:ubuntu:25.04@prep:
extends:
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '25.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
FDO_DISTRIBUTION_EXEC: $UBUNTU_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:ubuntu:24.04@prep:
extends:
- .fdo.container-build@ubuntu
@ -198,6 +282,20 @@ tier3:ubuntu:22.04@prep:
when: manual
allow_failure: true
tier3:debian:13@prep:
extends:
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '13'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
FDO_DISTRIBUTION_EXEC: $DEBIAN_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:debian:12@prep:
extends:
- .fdo.container-build@debian
@ -212,6 +310,20 @@ tier3:debian:12@prep:
when: manual
allow_failure: true
tier3:alpine:3.22@prep:
extends:
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: '3.22'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
FDO_DISTRIBUTION_EXEC: $ALPINE_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:alpine:3.21@prep:
extends:
- .fdo.container-build@alpine
@ -254,34 +366,6 @@ tier3:alpine:3.19@prep:
when: manual
allow_failure: true
tier3:centos:stream10@prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream10'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
tier3:centos:stream9@prep:
extends:
- .fdo.container-build@centos
stage: prep
variables:
GIT_STRATEGY: none
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
FDO_DISTRIBUTION_EXEC: $CENTOS_EXEC
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
when: manual
allow_failure: true
#################################################################
# #
# tierN stage #
@ -321,45 +405,115 @@ t_fedora:42:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:25.04:
t_fedora:rawhide:
extends:
- .build@template
- .fdo.distribution-image@fedora
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'rawhide'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier2:fedora:rawhide@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_centos:stream10:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'stream10'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier2:centos:stream10@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_centos:stream9:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier2:centos:stream9@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:devel:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: '25.04'
FDO_DISTRIBUTION_VERSION: 'devel'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier2:ubuntu:25.04@prep"
- "tier2:ubuntu:devel@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:13:
t_debian:testing:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: '13'
FDO_DISTRIBUTION_VERSION: 'testing'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:13@prep"
- "tier2:debian:testing@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.22:
t_debian:sid:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: 'sid'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier2:debian:sid@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:edge:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier2
variables:
FDO_DISTRIBUTION_VERSION: '3.22'
FDO_DISTRIBUTION_VERSION: 'edge'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier2:alpine:3.22@prep"
- "tier2:alpine:edge@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_fedora:43:
extends:
- .build@template
- .fdo.distribution-image@fedora
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '43'
FDO_DISTRIBUTION_TAG: $FEDORA_TAG
needs:
- "tier3:fedora:43@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
@ -377,6 +531,20 @@ t_fedora:41:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:25.04:
extends:
- .build@template
- .fdo.distribution-image@ubuntu
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '25.04'
FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
needs:
- "tier3:ubuntu:25.04@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_ubuntu:24.04:
extends:
- .build@template
@ -405,6 +573,20 @@ t_ubuntu:22.04:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:13:
extends:
- .build@template
- .fdo.distribution-image@debian
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '13'
FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
needs:
- "tier3:debian:13@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_debian:12:
extends:
- .build@template
@ -419,6 +601,20 @@ t_debian:12:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.22:
extends:
- .build@template
- .fdo.distribution-image@alpine
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: '3.22'
FDO_DISTRIBUTION_TAG: $ALPINE_TAG
needs:
- "tier3:alpine:3.22@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_alpine:3.21:
extends:
- .build@template
@ -461,34 +657,6 @@ t_alpine:3.19:
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_centos:stream10:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'stream10'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier3:centos:stream10@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
t_centos:stream9:
extends:
- .build@template
- .fdo.distribution-image@centos
- .nm_artifacts_debug
stage: tier3
variables:
FDO_DISTRIBUTION_VERSION: 'stream9'
FDO_DISTRIBUTION_TAG: $CENTOS_TAG
needs:
- "tier3:centos:stream9@prep"
rules:
- if: $CI_PIPELINE_SOURCE != 'schedule'
#################################################################
# #
# specific jobs #
@ -545,7 +713,7 @@ pages:
rules:
- if: $CI_PIPELINE_SOURCE == 'schedule'
when: never
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'main'
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
dependencies:
- "t_fedora:42: [meson+gcc+docs+valgrind]"
needs:

View file

@ -240,7 +240,7 @@ pages:
rules:
- if: $CI_PIPELINE_SOURCE == 'schedule'
when: never
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == 'main'
- if: $CI_PIPELINE_SOURCE == 'push' && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
dependencies:
- "t_{{default_distro.name}}:{{default_distro.versions[0]}}: [meson+gcc+docs+valgrind]"
needs:

View file

@ -27,42 +27,51 @@ distributions:
# TIER 2: distribution versions that will or might use the current NM version.
# Run when doing a release.
- name: fedora
tier: 2
versions:
- 'rawhide'
- name: centos
tier: 2
versions:
- 'stream10'
- 'stream9'
- name: ubuntu
tier: 2
versions:
- '25.04'
- 'devel'
- name: debian
tier: 2
versions:
- '13'
- 'testing'
- 'sid'
- name: alpine
tier: 2
versions:
- '3.22'
- 'edge'
# TIER 3: distribution versions not in EOL but don't use the current NM version.
# Run when doing a release, but a failure won't be blocking for the release.
- name: fedora
tier: 3
versions:
- '43'
- '41'
- name: ubuntu
tier: 3
versions:
- '25.04'
- '24.04'
- '22.04'
- name: debian
tier: 3
versions:
- '13'
- '12'
- name: alpine
tier: 3
versions:
- '3.22'
- '3.21'
- '3.20'
- '3.19'
- name: centos
tier: 3
versions:
- 'stream10'
- 'stream9'

View file

@ -8,18 +8,24 @@ fedora:
- version: rawhide
support: yes
nm: main
- version: 43
support: 2026-12-02
nm: 1.54
- version: 42
support: 2026-05-13
nm: 1.52
tier1-default: yes
- version: 41
support: 2025-11-19
nm: 1.50
tier1-default: yes
- version: 40
support: 2025-05-13
nm: 1.46
# CentOS Stream
centos:
- version: stream10
support: 2030-12-31 # exact date unknown, only the year
nm: main
- version: stream9
support: 2027-05-31
support: 2027-12-31 # exact date unknown, only the year
nm: main
# RHEL:
@ -31,33 +37,43 @@ centos:
# support: 6 months
# Releases and support info: https://access.redhat.com/support/policy/updates/errata
rhel:
- version: 9.6 # not released yet
# Not released yet
- version: 10.1
support: yes
nm: main
- version: 9.5
nm: 1.54
- version: 9.7 # not released yet
support: yes
nm: 1.48
nm: 1.54
# Full support or EUS support:
- version: 10.0
support: 2027-05-31
extended-support: 2029-05-31
nm: 1.52
- version: 9.6
support: 2027-05-31
extended-support: 2029-05-31
nm: 1.52
- version: 9.4
support: 2026-04-30
extended-support: 2028-04-30
nm: 1.46
- version: 9.2
support: 2025-05-31
extended-support: 2027-05-31
nm: 1.42
- version: 8.10 # last RHEL 8 release, maintenaince support only
support: 2029-05-31
extended-support: no
nm: 1.40
- version: 8.8
# SAP / Enhaced EUS only:
- version: 9.2
support: 2025-05-31
extended-support: 2027-05-31
nm: 1.40
# SAP / Enhaced EUS only:
nm: 1.42
- version: 9.0
support: 2024-05-31
extended-support: 2026-05-31
nm: 1.36
- version: 8.8
support: 2025-05-31
extended-support: 2027-05-31
nm: 1.40
- version: 8.6
support: 2024-05-31
extended-support: 2026-05-31
@ -77,10 +93,10 @@ ubuntu:
- version: devel
support: yes
nm: main
- version: 24.10
name: oracular
support: 2025-07-10
nm: 1.48
- version: 25.04
name: plucky
support: 2026-01-15
nm: 1.52
- version: 24.04
name: noble
support: 2029-05-31
@ -91,11 +107,6 @@ ubuntu:
support: 2027-06-01
extended-support: 2032-04-21
nm: 1.36
- version: 20.04
name: focal
support: 2025-05-29
extended-support: 2030-04-23
nm: 1.22
# Debian:
# cadence: every 2 years
@ -110,6 +121,11 @@ debian:
- version: sid
support: yes
nm: main
- version: 13
name: trixie
support: 2028-08-09
extended-support: 2030-06-30
nm: 1.52
- version: 12
name: bookworm
support: 2026-06-11
@ -131,6 +147,9 @@ alpine:
- version: edge
support: yes
nm: main
- version: 3.22
support: 2027-05-01
nm: 1.52
- version: 3.21
support: 2026-11-01
nm: 1.50
@ -140,6 +159,3 @@ alpine:
- version: 3.19
support: 2025-11-01
nm: 1.44
- version: 3.18
support: 2025-05-09
nm: 1.42

View file

@ -155,12 +155,7 @@ test_subtree() {
do_clean
pushd ./src/$d
ARGS=()
if [ "$d" = n-acd ]; then
ARGS+=('-Debpf=false')
fi
CC="$cc" CFLAGS="-Werror -Wall" meson build "${ARGS[@]}"
CC="$cc" CFLAGS="-Werror -Wall" meson build
ninja -v -C build test
popd

View file

@ -252,17 +252,25 @@ Versioning scheme (version numbers are called MAJOR.MINOR.MICRO):
versioning scheme than the main NM project despite there are no development
versions here.
Before starting:
- You need to have the maintainer role in the project.
- The GPG key used to sign the release must be added to your GNOME's Gitlab
profile and uploaded to a keyserver.
- All details: https://handbook.gnome.org/maintainers/making-a-release.html
When doing a release, follow this process:
1. Ensure that `NEWS` file is up to date.
2. Increment the version in `meson.build`, commit and tag the commit. Example:
`git tag -s 1.2.8 -m 'Tag 1.2.8'`.
3. Ensure that you are on the right commit and create the tarball:
`git clean -fdx && meson setup build && cd build && meson dist`
4. Upload the tarball: `scp ./*-*.tar.xz "$user@master.gnome.org:"`
5. Login to `master.gnome.org` and run `ftpadmin install`.
Ensure the new tarballs show up at https://download.gnome.org/sources/
(happens after a short delay)
6. Announce the release on the mailing list.
2. Increment the version in `meson.build` or `configure.ac`.
3. Commit and push to the `main` branch.
4. Check that the Gitlab's pipeline finishes without errors.
5. Tag the commit with a signed tag. Example: `git tag -s 1.2.8 -m 'Release 1.2.8'`.
6. Push the tag. Example: `git push origin 1.2.8`.
WARN: this is what starts the automatic CI release. As GNOME doesn't allow
to delete tags, any error detected after this will force a new version bump.
7. Check that the Gitlab's pipeline finishes without errors. If that happens,
the release is done and available both in the Gitlab's releases section and
https://download.gnome.org/sources/*
8. Announce the release on the mailing list.
Notes:
- You need access to master.gnome.org, see [here](https://handbook.gnome.org/infrastructure/accounts.html).

101
NEWS
View file

@ -1,27 +1,92 @@
===============================================
NetworkManager-1.52.2
Overview of changes since NetworkManager-1.52.1
===============================================
=============================================
NetworkManager-1.58
Overview of changes since NetworkManager-1.56
=============================================
* Support reapplying the "sriov.vfs" property as long as
"sriov.total-vfs" is not changed.
This is a snapshot of NetworkManager development. The API is
subject to change and not guaranteed to be compatible with
the later release.
USE AT YOUR OWN RISK. NOT RECOMMENDED FOR PRODUCTION USE!
* Restrict the connectivity check to use the DNS servers defined on the
same link. If the link has no DNS servers, the connectivity check will
use any servers available in the system.
* Install the systemd units in the initramfs using a systemd generator.
* A new "check-connectivity" configuration option is available to disable the
connectivity check for selected interfaces.
* Remove the modify_system build option that allowed setting up the
polkit permissions to allow non-admin users to create system-wide
connection. That configuration is discouraged because it can be used
to bypass filesystem permissions.
* For private connections (the ones that specify a user in the
"connection.permissions" property), verify that the user can access
the 802.1X certificates and keys set in the connection.
* Introduce a libnm function that can be used by VPN plugins to check
user permissions on certificate and keys.
* The support for Wireless Extensions is deprecated and will be
removed in a future release. Wireless Extensions are now disabled by
default.
=============================================
NetworkManager-1.52.1
NetworkManager-1.56
Overview of changes since NetworkManager-1.54
=============================================
* nmcli now supports viewing and managing WireGuard peers.
* Support reapplying the "sriov.vfs" property as long as
"sriov.total-vfs" is not changed.
* Support reapplying "bond-port.vlans".
* Accept hostnames longer than 64 characters from DNS lookup.
* Make that global-dns configuration overwrites DNS searches and
options from connections, instead of merging all together.
* Add support for a new rd.net.dhcp.client-id option in
nm-initrd-generator.
* Add gsm device-uid setting to restrict the devices the connection applies to.
* Support configuring the HSR protocol version via the
"hsr.protocol-version" property.
* Fix a bug that makes broadband connections auto-connect getting
blocked if the connection tries to reconnect when modem status is
"disconnecting" / "disconnected".
* Treat modem connection not having an operator code available
as a recoverable error.
* Add support for configuring systemd-resolved's DNSSEC option
per-connection via the "connection.dnssec" connection property.
* Support configuring the HSR interlink port via the
"hsr.interlink" property.
* Fix some connection properties not being applied to vpn connections
(connection.mdns, connection.llmnr, connection.dns-over-tls,
connection.mptcp-flags, ipv6.ip6-privacy)
* Update n-acd to always compile with eBPF enabled, as support
for eBPF is now detected at run time.
* Add new MPTCP 'laminar' endpoint type, and set it by default alongside
the 'subflow' one.
=============================================
NetworkManager-1.54
Overview of changes since NetworkManager-1.52
=============================================
* Fail early if we cannot get current FEC
(Forward Error Correction) value.
* Allow reapplying ovs-bridge and ovs-port properties.
* Add support for configuring per-device IPv4 forwarding via the
"ipv4.forwarding" connection property.
* Add a new "prefix-delegation" setting containing a "subnet-id"
property that specifies the subnet to choose on the downstream
interface when using IPv6 prefix delegation.
* Support OCI baremetal in nm-cloud-setup
* When activating a WireGuard connection to an IPv6 endpoint, now
NetworkManager creates firewall rules to ensure that the incoming
packets are not dropped by kernel reverse path filtering.
* Add support for configuring the loopback interface in nmtui.
* Most of the properties of ovs-bridge and ovs-port connections can
now be reapplied at runtime without bringing the connection down.
* Add a new "sriov.preserve-on-down" property that controls whether
NetworkManager preserves the SR-IOV parameters set on the device
when the connection is deactivated, or whether it resets them to
their default value.
* Introduce a new "ovs-dpdk.lsc-interrupt" property to configure the
Link State Change (LSC) detection mode for OVS DPDK interfaces.
* The initrd-generator now can parse the NVMe Boot Firmware Table
(NBFT) to configure networking during early boot.
* Add systemd services to provide networking in the initrd.
=============================================
NetworkManager-1.52
@ -216,7 +281,7 @@ Overview of changes since NetworkManager-1.42
lead to unexpected behaviors in case of multiconnect profiles.
* Set VLAN filtering options on bridge via netlink instead of sysfs.
* nm-cloud-setup now supports IMDSv2 on Amazon EC2.
* nmtui now allows to enable or disable Wi-Fi and WWAN radios.
* nmtui now supports enabling/disabling Wi-Fi and WWAN radios.
* Honor ignore-carrier=no for bond/bridge/team devices.
* Add version mismatch warning when running nmcli commands.
@ -381,7 +446,7 @@ Overview of changes since NetworkManager-1.38
* NetworkManager reads the kernel command line "/proc/cmdline" for several
purposes, including "nm.debug" for enabling debugging and the
"match.kernel-command-line" setting in the profile. NetworkManager now
first looks now for "/run/NetworkManager/proc-cmdline", which allows to
first looks now for "/run/NetworkManager/proc-cmdline", which allows one to
overwrite the command line.
* Improve the reapply of non-bridge properties.
* Honor adding a Bluetooth NAP connection with all available methods.
@ -454,7 +519,7 @@ Overview of changes since NetworkManager-1.36
* Workaround libcurl blocking NetworkManager while resolving DNS names.
* nmcli: indicate missing Wi-Fi hardware when showing rfkill setting.
* nmcli: add connection migrate command to move a profile to a specified
settings plugin. This allows to convert profiles in the deprecated ifcfg-rh
settings plugin. This allows one to convert profiles in the deprecated ifcfg-rh
format to keyfile.
* Set "src" attribute for routes from DHCPv4 to the leased address. This
helps with source address selection.
@ -586,7 +651,7 @@ and 1.32.12 are also present in NetworkManager-1.34:
* core: fix adding stale local routes when address changes.
* initrd: tag generated profiles with origin in user data.
* core: introduce "allowed-connections" option to disallow
profiles on a device. This allows to filter out profiles
profiles on a device. This allows one to filter out profiles
that originate from initrd.
* core: introduce "keep-configuration" device option to forcefully
activate a profile on start.
@ -647,7 +712,7 @@ Overview of changes since NetworkManager-1.30
'nm-daemon-helper' binary is spawned to perform the lookup using
the 'dns' NSS module.
* dhcp: honor "ID_NET_DHCP_BROADCAST" udev attribute to set the broadcast flag.
This allows to configure devices in udev for which DHCPOFFER messages are to be
This allows one to configure devices in udev for which DHCPOFFER messages are to be
broadcast.
* firewall: add nftables firewall backend for configuring IPv4 NAT with shared
mode. Now two backends are supported, "iptables" and "nftables". The default
@ -907,16 +972,16 @@ This is a new stable release of NetworkManager. Notable changes include:
in allowed-ips.
* Rework implementation of settings plugins and how profiles are presisted
to disk. This is a large internal refactoring of the settings plugins that
allows to migrate a connection profile between plugins.
allows one to migrate a connection profile between plugins.
* In-memory profiles are now only handled by keyfile plugin and will also be
persisted to /run directory. This allows to restart NetworkManager without
persisted to /run directory. This allows one to restart NetworkManager without
loosing these profiles and it provides a file-system based API for creating
in-memory profiles.
* Keyfile plugin now supports a read-only directory of profiles under directory
"/usr/lib/NetworkManager/system-connections". Such profiles still can be modified
and deleted via D-Bus, which results in writing profiles to /etc or /run that
shadow the read-only files.
* Add new D-Bus method AddConnection2() that allows to block autoconnect of
* Add new D-Bus method AddConnection2() that allows one to block autoconnect of
the profile at the moment when creating the profile. Also add support for
this API to libnm.
* Add flag "no-reapply" to Update2() D-Bus method. Normally, when a connection

View file

@ -112,6 +112,14 @@ contrib/fedora/rpm/NetworkManager.conf for how to enable debug logging
in NetworkManager.
Requirements
------------
NetworkManager requires:
- Linux kernel >= 5.6 for some ethtool options (pause, eee, ring)
Documentation
-------------

View file

@ -239,6 +239,15 @@
/* Whether we build with OVS plugin */
#mesondefine WITH_OPENVSWITCH
/* Whether we build with team support */
#mesondefine WITH_TEAMDCTL
/* Whether we build with Wi-Fi support */
#mesondefine WITH_WIFI
/* Whether we build with WWAN support */
#mesondefine WITH_WWAN
/* Define if you have PPP support */
#mesondefine WITH_PPP
@ -280,3 +289,8 @@
/* Define to 1 if you have history support from -lreadline. */
#mesondefine HAVE_READLINE_HISTORY
/* Define if NBFT support is enabled */
#mesondefine WITH_NBFT
/* Define to 1 if dlvsym() is available */
#mesondefine HAVE_DLVSYM

View file

@ -25,11 +25,11 @@ apk add \
'jansson-dev' \
'libgudev-dev' \
'libndp-dev' \
'libnvme-dev' \
'libnl3-dev' \
'libpsl-dev' \
'libsoup-dev' \
'libteam-dev' \
'libtool' \
'linux-headers' \
'meson' \
'mobile-broadband-provider-info' \

View file

@ -56,12 +56,12 @@ install \
libndp-dev \
libnewt-dev \
libnss3-dev \
libnvme-dev \
libpolkit-gobject-1-dev \
libpsl-dev \
libreadline-dev \
libsystemd-dev \
libteam-dev \
libtool \
libudev-dev \
locales \
meson \

View file

@ -66,8 +66,8 @@ install \
jq \
libcurl-devel \
libndp-devel \
libnvme-devel \
libselinux-devel \
libtool \
libuuid-devel \
meson \
mobile-broadband-provider-info-devel \

View file

@ -14,6 +14,7 @@
%global epoch_version 1
%global real_version __VERSION__
%global git_tag_version __GIT_TAG_VERSION__
%global rpm_version %{real_version}
%global release_version __RELEASE_VERSION__
%global snapshot __SNAPSHOT__
@ -106,6 +107,11 @@
%else
%bcond_without iwd
%endif
%if 0%{?fedora} <= 43 || 0%{?rhel} <= 10
%bcond_without polkit_noauth_group
%else
%bcond_with polkit_noauth_group
%endif
###############################################################################
@ -153,17 +159,6 @@
%bcond_with ifcfg_migrate
%endif
%if 0%{?fedora}
# Although eBPF would be available on Fedora's kernel, it seems
# we often get SELinux denials (rh#1651654). But even aside them,
# bpf(BPF_MAP_CREATE, ...) randomly fails with EPERM. That might
# be related to `ulimit -l`. Anyway, this is not usable at the
# moment.
%global ebpf_enabled "no"
%else
%global ebpf_enabled "no"
%endif
# Fedora 33 enables LTO by default by setting CFLAGS="-flto -ffat-lto-objects".
# However, we also require "-flto -flto-partition=none", so disable Fedora's
# default and use our configure option --with-lto instead.
@ -180,7 +175,7 @@ Group: System Environment/Base
License: GPL-2.0-or-later AND LGPL-2.1-or-later
URL: https://networkmanager.dev/
#Source: https://download.gnome.org/sources/NetworkManager/%{real_version_major}/%{name}-%{real_version}.tar.xz
#Source: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/releases/%{git_tag_version}/downloads/%{name}-%{real_version}.tar.xz
Source: __SOURCE1__
Source1: NetworkManager.conf
Source2: 00-server.conf
@ -253,7 +248,6 @@ Conflicts: NetworkManager-dispatcher-routing-rules <= 1:1.47.5-3
%endif
BuildRequires: gcc
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: meson
BuildRequires: gettext-devel >= 0.19.8
@ -307,6 +301,7 @@ BuildRequires: libubsan
BuildRequires: firewalld-filesystem
BuildRequires: iproute
BuildRequires: iproute-tc
BuildRequires: libnvme-devel >= 1.5
Provides: %{name}-dispatcher%{?_isa} = %{epoch}:%{version}-%{release}
@ -626,14 +621,10 @@ Preferably use nmcli instead.
%endif
%if %{with wifi}
-Dwifi=true \
%if 0%{?fedora}
-Dwext=true \
%else
-Dwext=false \
%endif
%else
-Dwifi=false \
%endif
-Dwext=false \
%if %{with iwd}
-Diwd=true \
%else
@ -675,22 +666,20 @@ Preferably use nmcli instead.
-Dselinux=true \
-Dpolkit=true \
-Dconfig_auth_polkit_default=true \
-Dmodify_system=true \
%if %{with polkit_noauth_group}
-Dpolkit_noauth_group=wheel \
%endif
-Dconcheck=true \
%if 0%{?fedora}
-Dlibpsl=true \
%else
-Dlibpsl=false \
%endif
%if %{ebpf_enabled} != "yes"
-Debpf=false \
%else
-Debpf=true \
%endif
-Dsession_tracking=systemd \
-Dsuspend_resume=systemd \
-Dsystemdsystemunitdir=%{_unitdir} \
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
-Dsystemdsystemgeneratordir=%{_systemdgeneratordir} \
-Dsystem_ca_path=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem \
-Ddbus_conf_dir=%{dbus_sys_dir} \
-Dtests=yes \
-Dvalgrind=no \
@ -761,6 +750,12 @@ rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/pppd/%{ppp_version}/*.la
rm -f %{buildroot}%{nmplugindir}/*.la
# Don't use the *-initrd.service files yet, wait dracut to support them
rm -f %{buildroot}%{_systemdgeneratordir}/nm-initrd-generator.sh
rm -f %{buildroot}%{_unitdir}/NetworkManager-config-initrd.service
rm -f %{buildroot}%{_unitdir}/NetworkManager-initrd.service
rm -f %{buildroot}%{_unitdir}/NetworkManager-wait-online-initrd.service
# Ensure the documentation timestamps are constant to avoid multilib conflicts
find %{buildroot}%{_datadir}/gtk-doc -exec touch --reference meson.build '{}' \+
@ -922,6 +917,9 @@ fi
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_dispatcher.service
%{_datadir}/dbus-1/system-services/org.freedesktop.nm_priv_helper.service
%{_datadir}/polkit-1/actions/*.policy
%if %{with polkit_noauth_group}
%{_datadir}/polkit-1/rules.d/org.freedesktop.NetworkManager.rules
%endif
%{_prefix}/lib/udev/rules.d/*.rules
%{_prefix}/lib/firewalld/zones/nm-shared.xml
# systemd stuff

View file

@ -12,6 +12,7 @@ set -o pipefail
# RELEASE_VERSION=
# SNAPSHOT=
# VERSION=
# GIT_TAG_VERSION=
# COMMIT_FULL=
# COMMIT=
# USERNAME=
@ -112,6 +113,7 @@ UUID=`uuidgen`
RELEASE_VERSION="${RELEASE_VERSION:-$(git rev-list HEAD | wc -l)}"
SNAPSHOT="${SNAPSHOT:-%{nil\}}"
VERSION="${VERSION:-$(get_version || die "Could not read $VERSION")}"
GIT_TAG_VERSION="${GIT_TAG_VERSION:-$VERSION}"
COMMIT_FULL="${COMMIT_FULL:-$(git rev-parse --verify HEAD || die "Error reading HEAD revision")}"
COMMIT="${COMMIT:-$(printf '%s' "$COMMIT_FULL" | sed 's/^\(.\{10\}\).*/\1/' || die "Error reading HEAD revision")}"
BCOND_DEFAULT_DEBUG="${BCOND_DEFAULT_DEBUG:-0}"
@ -155,6 +157,7 @@ if [[ "$SOURCE_FROM_GIT" == "1" ]]; then
fi
LOG "VERSION=$VERSION"
LOG "GIT_TAG_VERSION=$GIT_TAG_VERSION"
LOG "RELEASE_VERSION=$RELEASE_VERSION"
LOG "SNAPSHOT=$SNAPSHOT"
LOG "COMMIT_FULL=$COMMIT_FULL"
@ -207,6 +210,7 @@ cp "$SOURCE_README_IFCFG_MIGRATED" "$TEMP/SOURCES/readme-ifcfg-rh-migrated.txt"
write_changelog
sed -e "s/__VERSION__/$VERSION/g" \
-e "s/__GIT_TAG_VERSION__/$GIT_TAG_VERSION/g" \
-e "s/__RELEASE_VERSION__/$RELEASE_VERSION/g" \
-e "s/__SNAPSHOT__/$SNAPSHOT/g" \
-e "s/__COMMIT__/$COMMIT/g" \

View file

@ -143,7 +143,7 @@ while [[ $# -gt 0 ]]; do
;;
--no-auto-with-test)
# by default, the script adds "-w test" (unless the command line contains
# "-w test" or "-W test"). This flags allows to suppress that automatism.
# "-w test" or "-W test"). This flag suppresses that automatism.
# It's really only useful to test the spec file's internal default for the
# "test" option. Otherwise, you can always just explicitly select "-w test"
# or "-W test".

View file

@ -155,7 +155,6 @@ P_CRYPTO="${CRYPTO-}"
P_DBUS_SYS_DIR="${DBUS_SYS_DIR-}"
P_DHCP_DEFAULT="${DHCP_DEFAULT-}"
P_DNS_RC_MANAGER_DEFAULT="${DNS_RC_MANAGER_DEFAULT-}"
P_EBPF_ENABLED="${EBPF_ENABLED-no}"
P_FIREWALLD_ZONE="${FIREWALLD_ZONE-}"
P_IWD="${IWD-}"
P_LOGGING_BACKEND_DEFAULT="${LOGGING_BACKEND_DEFAULT-}"
@ -174,6 +173,7 @@ P_WIFI="${WIFI-1}"
P_WWAN="${WWAN-1}"
P_TEAM="${TEAM-1}"
P_BLUETOOTH="${BLUETOOTH-1}"
P_IFCFG_RH="${IFCFG_RH-0}"
P_NMTUI="${NMTUI-1}"
P_NM_CLOUD_SETUP="${NM_CLOUD_SETUP-1}"
P_OVS="${OVS-1}"
@ -203,7 +203,7 @@ if [ -z "$P_FEDORA" -a -z "$P_RHEL" ] ; then
P_FEDORA="$x"
P_RHEL=0
else
x="$(grep -q "ID=fedora" /etc/os-release && sed -n 's/VERSION_ID=//p' /etc/os-release)"
x="$(grep -q 'ID="rhel"' /etc/os-release && sed -n 's/^VERSION_ID="*\([0-9]*\).*/\1/p' /etc/os-release)"
if test "$x" -gt 0 ; then
P_FEDORA=0
P_RHEL="$x"
@ -294,6 +294,14 @@ if [ -z "$P_MODEM_MANAGER_1" ] ; then
fi
fi
if [ -z "$TEAM" ] && [ "${P_RHEL-0}" -ge 10 ] ; then
P_TEAM=0
fi
if [ -z "$IFCFG_RH" ] && [ -n "$P_RHEL" ] && [ "$P_RHEL" -le 9 ] ; then
P_IFCFG_RH=1
fi
if bool "$P_DEBUG" ; then
P_CFLAGS="-g -Og -fexceptions${P_CFLAGS:+ }$P_CFLAGS"
else
@ -379,7 +387,7 @@ meson setup\
-Db_lto="$(bool_true "$P_LTO")" \
-Dlibaudit=yes-disabled-by-default \
-Dmodem_manager="$(bool_true "$P_MODEM_MANAGER_1")" \
$(args_enable "$P_WIFI" -Dwifi=true -Dwext="$(bool_true "$P_FEDORA")") \
$(args_enable "$P_WIFI" -Dwifi=true -Dwext=false) \
$(args_enable "$(bool_not_true "$P_WIFI")" -Dwifi=false ) \
-Diwd="$(bool_true "$P_IWD")" \
-Dbluez5_dun="$(bool_true "$P_BLUETOOTH")" \
@ -393,18 +401,17 @@ meson setup\
-Dselinux=true \
-Dpolkit=true \
-Dconfig_auth_polkit_default=true \
-Dmodify_system=true \
-Dconcheck=true \
-Dlibpsl="$(bool_true "$P_FEDORA")" \
-Debpf="$(bool_true "$P_EBPF_ENABLED")" \
-Dsession_tracking=systemd \
-Dsuspend_resume=systemd \
-Dsystemdsystemunitdir=/usr/lib/systemd/system \
-Dsystemdsystemgeneratordir=/usr/lib/systemd/system-generators \
-Dsystem_ca_path=/etc/pki/tls/cert.pem \
-Ddbus_conf_dir="$P_DBUS_SYS_DIR" \
-Dtests=yes \
-Dvalgrind=no \
-Difcfg_rh=true \
-Difcfg_rh="$(bool_true "$P_IFCFG_RH")" \
-Difupdown=false \
$(args_enable "$P_PPP" -Dppp=true -Dpppd="$D_SBINDIR/pppd" -Dpppd_plugin_dir="$D_LIBDIR/pppd/$P_PPP_VERSION") \
$(args_enable "$(bool_not_true "$P_PPP")" -Dppp=false ) \

View file

@ -265,9 +265,11 @@ detect_dirname() {
# At some point FEDPKG changed the behavior of "prep" command
# now it generates the directory with "-build" suffix and the
# real directory inside. We just move it out.
rm -rf $D
mv $D-build/$D .
rm -rf $D-build
if [ -d "$D-build" ]; then
rm -rf "$D"
mv "$D-build/$D" .
rm -rf "$D-build"
fi
[[ -d "$D" ]] && DIRS=("${DIRS[@]}" "$D")
done
done

View file

@ -54,10 +54,15 @@ _WITH_WERROR=1
_WITH_LIBTEAM="true"
_WITH_DOCS="true"
_WITH_SYSTEMD_LOGIND="true"
_WITH_NBFT="true"
if [ $IS_ALPINE = 1 ]; then
_WITH_SYSTEMD_LOGIND="false"
fi
if ! pkgconf 'libnvme >= 1.5'; then
_WITH_NBFT="false"
fi
if [ -z "${NMTST_SEED_RAND+x}" ]; then
NMTST_SEED_RAND="$SRANDOM"
if [ -z "$NMTST_SEED_RAND" ]; then
@ -164,18 +169,18 @@ meson setup build \
-D ld_gc=false \
-D session_tracking=no \
-D systemdsystemunitdir=no \
-D systemdsystemgeneratordir=no \
-D systemd_journal=false \
-D selinux=false \
-D libaudit=no \
-D libpsl=false \
-D vapi=false \
-D introspection=$_WITH_DOCS \
-D man=$_WITH_DOCS \
-D qt=false \
-D crypto=$_WITH_CRYPTO \
-D docs=$_WITH_DOCS \
\
-D ebpf=false \
\
-D iwd=true \
-D ofono=true \
-D teamdctl=$_WITH_LIBTEAM \
@ -189,6 +194,8 @@ meson setup build \
-D ifcfg_rh=false \
-D ifupdown=true \
\
-D nbft=$_WITH_NBFT \
\
#end
export NM_TEST_CLIENT_CHECK_L10N=1

View file

@ -0,0 +1,24 @@
[Unit]
Description=NetworkManager Configuration (initrd)
AssertPathExists=/etc/initrd-release
DefaultDependencies=no
Wants=systemd-journald.socket
After=systemd-journald.socket
Before=systemd-udevd.service systemd-udev-trigger.service
[Service]
Type=oneshot
ExecStartPre=/bin/sh -c "rm -f /run/NetworkManager/system-connections/*"
ExecStart=/bin/sh -c "@libexecdir@/nm-initrd-generator -- $(cat /proc/cmdline)"
ExecStartPost=/bin/sh -c ' \
for i in /{usr/lib,run,etc}/NetworkManager/system-connections/*; do \
[ -f "$i" ] || continue; \
mkdir -p /run/NetworkManager/initrd; \
: > /run/NetworkManager/initrd/neednet; \
break; \
done; \
if [ -s /run/NetworkManager/initrd/hostname ]; then \
cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname; \
fi \
'
RemainAfterExit=yes

View file

@ -0,0 +1,24 @@
[Unit]
Description=NetworkManager (initrd)
AssertPathExists=/etc/initrd-release
DefaultDependencies=no
Wants=systemd-udev-trigger.service network.target
After=systemd-udev-trigger.service network-pre.target dbus.service NetworkManager-config-initrd.service
Before=network.target
BindsTo=dbus.service
ConditionPathExists=/run/NetworkManager/initrd/neednet
ConditionPathExistsGlob=|/usr/lib/NetworkManager/system-connections/*
ConditionPathExistsGlob=|/run/NetworkManager/system-connections/*
ConditionPathExistsGlob=|/etc/NetworkManager/system-connections/*
[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
ExecReload=/usr/bin/busctl call org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Reload u 0
ExecStart=@sbindir@/NetworkManager
# NM doesn't want systemd to kill its children for it
KillMode=process
Environment=NM_CONFIG_ENABLE_TAG=initrd
Restart=on-failure
ProtectSystem=true
ProtectHome=read-only

View file

@ -0,0 +1,23 @@
[Unit]
Description=NetworkManager Wait Online (initrd)
AssertPathExists=/etc/initrd-release
DefaultDependencies=no
Requires=NetworkManager-initrd.service
After=NetworkManager-initrd.service
Before=network-online.target
ConditionPathExists=/run/NetworkManager/initrd/neednet
[Service]
# `nm-online -s` waits until the point when NetworkManager logs
# "startup complete". That is when startup actions are settled and
# devices and profiles reached a conclusive activated or deactivated
# state. It depends on which profiles are configured to autoconnect and
# also depends on profile settings like ipv4.may-fail/ipv6.may-fail,
# which affect when a profile is considered fully activated.
# Check NetworkManager logs to find out why wait-online takes a certain
# time.
Type=oneshot
ExecStart=@bindir@/nm-online -s -q
RemainAfterExit=yes
Environment=NM_ONLINE_TIMEOUT=3600

View file

@ -19,7 +19,7 @@ KillMode=process
# With a huge number of interfaces, starting can take a long time.
TimeoutStartSec=600
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT
CapabilityBoundingSet=CAP_NET_ADMIN CAP_DAC_OVERRIDE CAP_NET_RAW CAP_BPF CAP_NET_BIND_SERVICE CAP_SETGID CAP_SETUID CAP_SYS_MODULE CAP_AUDIT_WRITE CAP_KILL CAP_SYS_CHROOT
ProtectSystem=true
ProtectHome=read-only

View file

@ -13,6 +13,9 @@ if install_systemdunitdir
'NetworkManager.service',
'nm-priv-helper.service',
'NetworkManager-wait-online.service',
'NetworkManager-config-initrd.service',
'NetworkManager-initrd.service',
'NetworkManager-wait-online-initrd.service',
]
foreach service: services
@ -52,21 +55,22 @@ if install_udevdir
endif
if enable_polkit
policy = 'org.freedesktop.NetworkManager.policy'
policy_in = configure_file(
input: policy + '.in.in',
output: '@BASENAME@',
configuration: data_conf,
)
i18n.merge_file(
input: policy_in,
input: 'org.freedesktop.NetworkManager.policy.in',
output: '@BASENAME@',
po_dir: po_dir,
install: true,
install_dir: polkit_gobject_policydir,
install_dir: polkit_policydir,
)
if polkit_noauth_group != ''
configure_file(
input: 'org.freedesktop.NetworkManager.rules.in',
output: '@BASENAME@',
install_dir: polkit_rulesdir,
configuration: {'NM_POLKIT_NOAUTH_GROUP': polkit_noauth_group},
)
endif
endif
if enable_firewalld_zone

View file

@ -2,8 +2,8 @@
Description=NetworkManager Privileged Helper
#
# nm-priv-helper exists for privilege separation. It allows to run
# NetworkManager without certain capabilities, and ask nm-priv-helper
# nm-priv-helper exists for privilege separation. It allows NetworkManager
# to run without certain capabilities, and ask nm-priv-helper
# for special operations where more privileges are required.
#

View file

@ -117,8 +117,8 @@
<message>System policy prevents modification of network settings for all users</message>
<defaults>
<allow_any>auth_admin_keep</allow_any>
<allow_inactive>@NM_MODIFY_SYSTEM_POLICY@</allow_inactive>
<allow_active>@NM_MODIFY_SYSTEM_POLICY@</allow_active>
<allow_inactive>auth_admin_keep</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
</action>

View file

@ -0,0 +1,17 @@
// NetworkManager authorizations/policy for the @NM_POLKIT_NOAUTH_GROUP@ group.
//
// DO NOT EDIT THIS FILE, it will be overwritten on update.
//
// Allow users in the @NM_POLKIT_NOAUTH_GROUP@ group to create system-wide connections without being
// prompted for a password if they are in a local console.
// This is optional and is only recommended to maintain backwards compatibility
// in systems where it was already working in this way. It is discouraged
// otherwise.
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" &&
subject.isInGroup("@NM_POLKIT_NOAUTH_GROUP@") &&
subject.local) {
return polkit.Result.YES;
}
});

View file

@ -1,6 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
if enable_introspection
xsltproc = find_program('xsltproc')
settings = 'settings-spec'
output = settings + '.xml'

View file

@ -341,6 +341,7 @@ print ("NetworkManager version " + client.get_version())]]></programlisting></in
<xi:include href="xml/nm-setting-ovs-port.xml"/>
<xi:include href="xml/nm-setting-ppp.xml"/>
<xi:include href="xml/nm-setting-pppoe.xml"/>
<xi:include href="xml/nm-setting-prefix-delegation.xml"/>
<xi:include href="xml/nm-setting-proxy.xml"/>
<xi:include href="xml/nm-setting-serial.xml"/>
<xi:include href="xml/nm-setting-sriov.xml"/>

View file

@ -23,8 +23,8 @@ static const char *
nm_state_to_string(NMState state)
{
switch (state) {
case NM_STATE_ASLEEP:
return "asleep";
case NM_STATE_DISABLED:
return "network off";
case NM_STATE_CONNECTING:
return "connecting";
case NM_STATE_CONNECTED_LOCAL:

View file

@ -188,7 +188,7 @@ def create_nmc(dbus_connection):
# which has an overhead.
#
# Also, split the GObject creation and the init_async() call in two.
# That allows to pass construct-only parameters, in particular like
# That allows one to pass construct-only parameters, in particular like
# the instance_flags.
# Create a separate context for the NMClient. The NMClient is strongly

View file

@ -0,0 +1,92 @@
#!/usr/bin/env python
# SPDX-License-Identifier: LGPL-2.1-or-later
import gi
gi.require_version("NM", "1.0")
from gi.repository import GLib, NM, Gio
# This example shows how to implement a very simple secret agent for
# NetworkManager. The secret agent registers to the NM daemon and can
# provide missing secrets like Wi-Fi or VPN passwords. Set environment
# variable "LIBNM_CLIENT_DEBUG=trace" to enable libnm verbose logging.
class SecretAgent(NM.SecretAgentOld):
def __init__(self):
super().__init__(identifier="MySecretAgent")
super().init()
def do_get_secrets(
self,
connection,
connection_path,
setting_name,
hints,
flags,
callback,
callback_data,
):
print(
"get_secrets for '{}', interface '{}', setting '{}'".format(
connection.get_id(), connection.get_interface_name(), setting_name
)
)
# Implement here the logic to retrieve the secrets.
# As an example, we return a hardcoded Wi-Fi PSK.
if (
connection.get_connection_type() == "802-11-wireless"
and setting_name == "802-11-wireless-security"
):
s_wifi = connection.get_setting_wireless()
ssid = NM.utils_ssid_to_utf8(s_wifi.get_ssid().get_data())
if ssid == "home":
secrets = GLib.Variant(
"a{sa{sv}}",
{
"802-11-wireless-security": {
"psk": GLib.Variant("s", "abcd1234")
}
},
)
print("Sending secrets {}".format(secrets))
callback(self, connection, secrets, None)
return
# We don't have the secret, NM will ask to another agent or fail
callback(
self,
connection,
None,
GLib.GError.new_literal(
NM.SecretAgentError.quark(),
"No secrets found",
NM.SecretAgentError.NOSECRETS,
),
)
def do_cancel_get_secrets(self, connection_path, connection_name):
pass
def do_save_secrets(self, connection, connection_path, callback, callback_data):
# Implement this if you want to store "agent-owned" secrets
callback(self, connection, None)
def do_delete_secrets(self, connection, connection_path, callback, callback_data):
# Implement this if you want to store "agent-owned" secrets
callback(self, connection, None)
def main():
agent = SecretAgent()
loop = GLib.MainLoop()
try:
loop.run()
except KeyboardInterrupt:
print("Exiting Secret Agent...")
if __name__ == "__main__":
main()

View file

@ -321,7 +321,7 @@
<!--
Reapply:
@connection: The optional connection settings that will be reapplied on the device. If empty, the currently active settings-connection will be used. The connection cannot arbitrarily differ from the current applied-connection otherwise the call will fail. Only certain changes are supported, like adding or removing IP addresses.
@version_id: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows to catch concurrent modifications between the GetAppliedConnection call and Reapply.
@version_id: If non-zero, the current version id of the applied-connection must match. The current version id can be retrieved via GetAppliedConnection. This optional argument allows one to catch concurrent modifications between the GetAppliedConnection call and Reapply.
@flags: Flags which would modify the behavior of the Reapply call. Invalid flags are rejected.
Attempts to update the configuration of a device without deactivating it.
@ -337,7 +337,7 @@
settings-connection, or call Reapply. The Reapply call allows you to
directly update the applied-connection and reconfigure the device. Reapply
can also be useful if the currently applied-connection is equal to the
connection that is about to be reapplied. This allows to reconfigure the
connection that is about to be reapplied. This allows one to reconfigure the
device and revert external changes like removing or adding an IP address
(which NetworkManager doesn't revert automatically because it is assumed
that the user made these changes intentionally outside of NetworkManager).

View file

@ -83,6 +83,11 @@
note that your distribution or other packages may drop configuration snippets for NetworkManager, such
that they are part of the factory default.
</para>
<para>
The options that are indicated as boolean can be set to one of these values:
<literal>yes</literal>, <literal>true</literal>, <literal>on</literal>, <literal>1</literal>,
<literal>no</literal>, <literal>false</literal>, <literal>off</literal>, <literal>0</literal>.
</para>
</refsect1>
@ -271,8 +276,7 @@ no-auto-default=*
Set the management mode of the hostname. This parameter will
affect only the transient hostname. If a valid static hostname is set,
NetworkManager will skip the update of the hostname despite the value of
this option. An hostname empty or equal to 'localhost', 'localhost6',
'localhost.localdomain' or 'localhost6.localdomain' is considered invalid.
this option. A hostname empty or equal to '(none)' is considered invalid.
</para>
<para><literal>default</literal>: NetworkManager will update the
hostname with the one provided via DHCP or reverse DNS lookup of the
@ -896,11 +900,15 @@ ipv6.ip6-privacy=0
</varlistentry>
<varlistentry>
<term><varname>connection.mptcp-flags</varname></term>
<listitem><para>If unspecified, the fallback is 0x22 (<literal>"enabled,subflow"</literal>). Note that if sysctl <literal>/proc/sys/net/mptcp/enabled</literal> is disabled, NetworkManager will still not configure endpoints.</para></listitem>
<listitem><para>If unspecified, the fallback is 0x122 (<literal>"enabled,subflow,laminar"</literal>). Note that if sysctl <literal>/proc/sys/net/mptcp/enabled</literal> is disabled, NetworkManager will still not configure endpoints.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.dns-over-tls</varname></term>
<listitem><para>If unspecified, the ultimate default values depends on the DNS plugin. With systemd-resolved the default currently is global setting and for all other plugins "no" (0).</para></listitem>
<listitem><para>If unspecified, the ultimate default values depends on the DNS plugin. With systemd-resolved the default currently is its global setting and for all other plugins "no" (0).</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.dnssec</varname></term>
<listitem><para>If unspecified, the ultimate default values depends on the DNS plugin. With systemd-resolved the default currently is its global setting and for all other plugins "no" (0).</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>connection.stable-id</varname></term>
@ -942,6 +950,10 @@ ipv6.ip6-privacy=0
<term><varname>ip-tunnel.mtu</varname></term>
<listitem><para>If configured explicitly to 0, the MTU is not reconfigured during device activation unless it is required due to IPv6 constraints. If left unspecified, a DHCP/IPv6 SLAAC provided value is used or a default of 1500.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.forwarding</varname></term>
<listitem><para>Whether to configure IPv4 sysctl interface-specific forwarding. When enabled, the interface will act as a router to forward the IPv4 packet from one interface to another. If left unspecified, "auto" is used, so NetworkManager sets the IPv4 forwarding if any shared connection is active, or it will use the kernel default value otherwise. The "ipv4.forwarding" property is ignored when "ipv4.method" is set to "shared", because forwarding is always enabled in this case. The accepted values are: 0: disabled, 1: enabled, 2: auto, 3: ignored (leave the forwarding unchanged).</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>ipv4.routed-dns</varname></term>
</varlistentry>
@ -1090,6 +1102,12 @@ ipv6.ip6-privacy=0
<term><varname>sriov.autoprobe-drivers</varname></term>
<listitem><para>If left unspecified, drivers are autoprobed when the SR-IOV VF gets created.</para></listitem>
</varlistentry>
<varlistentry>
<term><varname>sriov.preserve-on-down</varname></term>
<listitem><para>Set to 0 or 1 to select whether the SR-IOV parameters are
preserved when the connection is deactivated. If left unspecified, default
to 0 (parameters are not preserved). </para></listitem>
</varlistentry>
<varlistentry>
<term><varname>vpn.timeout</varname></term>
<listitem><para>If left unspecified, default value of 60 seconds is used.</para></listitem>
@ -1236,12 +1254,13 @@ managed=1
<term><varname>managed</varname></term>
<listitem>
<para>
Whether the device is managed or not. A device can be
marked as managed via udev rules (ENV{NM_UNMANAGED}),
or via setting plugins (keyfile.unmanaged-devices).
This is yet another way. Note that this configuration
can be overruled at runtime via D-Bus. Also, it has
higher priority then udev rules.
A boolean value specifying whether the device is
managed or not. A device can be marked as managed via
udev rules (ENV{NM_UNMANAGED}), or via setting plugins
(keyfile.unmanaged-devices). This is yet another
way. Note that this configuration can be overruled at
runtime via D-Bus. Also, it has higher priority than
udev rules.
</para>
</listitem>
</varlistentry>
@ -1310,9 +1329,27 @@ managed=1
</para>
</listitem>
</varlistentry>
<varlistentry id="keep-configuration">
<term><varname>keep-configuration</varname></term>
<varlistentry id="check-connectivity">
<term><varname>check-connectivity</varname></term>
<listitem>
<para>
A boolean value specifying whether NetworkManager will perform a connectivity check
for this device. Defaults to <literal>yes</literal>.
</para>
<para>
This setting does nothing if the connectivity check has been
disabled globally using the
<literal>connectivity.enabled</literal> setting.
</para>
</listitem>
</varlistentry>
<varlistentry id="keep-configuration">
<term><varname>keep-configuration</varname></term>
<listitem>
<para>
A boolean value indicating whether the existing device
configuration is kept at startup.
</para>
<para>
On startup, NetworkManager tries to not interfere with
interfaces that are already configured. It does so by
@ -1375,7 +1412,7 @@ managed=1
scanning. This defaults to <literal>yes</literal> in which case
a random, locally-administered MAC address will be used.
The setting <literal>wifi.scan-generate-mac-address-mask</literal>
allows to influence the generated MAC address to use certain vendor
can be used to influence the generated MAC address to use certain vendor
OUIs.
If disabled, the MAC address during scanning is left unchanged to
whatever is configured.
@ -1399,7 +1436,7 @@ managed=1
<listitem>
<para>
Like the per-connection settings <literal>ethernet.generate-mac-address-mask</literal>
and <literal>wifi.generate-mac-address-mask</literal>, this allows to configure the
and <literal>wifi.generate-mac-address-mask</literal>, this can be used to configure the
generated MAC addresses during scanning. See <citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry>
for details.
</para>
@ -1409,16 +1446,16 @@ managed=1
<term><varname>wifi.iwd.autoconnect</varname></term>
<listitem>
<para>
If <literal>wifi.backend</literal> is <literal>iwd</literal>, setting this to
<literal>false</literal> forces IWD's autoconnect mechanism to be disabled for
this device and connections will only be initiated by NetworkManager whether
commanded by a client or automatically. Leaving it <literal>true</literal> (default)
stops NetworkManager from automatically initiating connections and allows
IWD to use its network ranking and scanning logic to decide the best networks
to autoconnect to next. Connections' <literal>autoconnect-priority</literal>,
<literal>autoconnect-retries</literal> settings will be ignored. Other settings
like <literal>permissions</literal> or <literal>multi-connect</literal> may interfere
with IWD connection attempts.
A boolean value. If <literal>wifi.backend</literal> is <literal>iwd</literal>,
setting this to <literal>false</literal> forces IWD's autoconnect mechanism to be
disabled for this device and connections will only be initiated by NetworkManager
whether commanded by a client or automatically. Leaving it <literal>true</literal>
(default) stops NetworkManager from automatically initiating connections and allows
IWD to use its network ranking and scanning logic to decide the best networks to
autoconnect to next. Connections' <literal>autoconnect-priority</literal>,
<literal>autoconnect-retries</literal> settings will be ignored. Other settings like
<literal>permissions</literal> or <literal>multi-connect</literal> may interfere with
IWD connection attempts.
</para>
</listitem>
</varlistentry>
@ -1477,7 +1514,7 @@ managed=1
<variablelist>
<varlistentry>
<term><varname>enabled</varname></term>
<listitem><para>Whether connectivity check is enabled.
<listitem><para>A boolean indicating whether connectivity check is enabled.
Note that to enable connectivity check, a valid uri must
also be configured. The value defaults to true, but since
the uri is unset by default, connectivity check may be disabled.
@ -1531,8 +1568,12 @@ managed=1
<refsect1>
<title><literal>global-dns</literal> section</title>
<para>This section specifies DNS settings that are applied
globally, in addition to connection-specific ones.</para>
<para>This section specifies DNS settings that are applied globally. They
override the equivalent options defined in individual connections, making
them to be ignored. If a [global-dns-domain-*] section is defined, but this
section isn't, an empty [global-dns] section is assumed, thus overwriting
connection specific configurations too.
</para>
<para>
<variablelist>
<varlistentry>
@ -1581,7 +1622,7 @@ managed=1
<refsect1>
<title><literal>global-dns-domain</literal> sections</title>
<para>Sections with a name starting with the "global-dns-domain-"
prefix allow to define global DNS configuration for specific
prefix allow one to define global DNS configuration for specific
domains. The part of section name after "global-dns-domain-"
specifies the domain name a section applies to (for example, a
section could be named "global-dns-domain-foobar.com"). More
@ -1592,6 +1633,10 @@ managed=1
default domain "*". When the global DNS domains are valid, the
name servers and domains defined globally override the ones from
active connections.
If any global DNS domain is defined but a [global-dns] section isn't,
an empty [global-dns] section is assumed, thus overwriting its
connection specific configurations too.
</para>
<para>
<variablelist>

View file

@ -1,29 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
common_ent_file = configure_file(
input: 'common.ent.in',
output: '@BASENAME@',
configuration: data_conf,
)
xsltproc_options = [
xsltproc,
'--output', '@OUTPUT@',
'--path', meson.current_build_dir(),
'--xinclude',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'--stringparam', 'man.th.title.max.length', '30',
]
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
mans_xmls = []
mans = [
['NetworkManager', '8'],
['NetworkManager-dispatcher', '8'],
@ -44,24 +20,74 @@ if enable_nm_cloud_setup
mans += [['nm-cloud-setup', '8']]
endif
foreach man: mans
input = man[0] + '.xml'
content_files += join_paths(meson.current_source_dir(), input)
introspection_mans = [
['nm-settings-keyfile', '5'],
['nm-settings-dbus', '5'],
['nm-settings-nmcli', '5'],
]
output = '@0@.@1@'.format(man[0], man[1])
if enable_ifcfg_rh
introspection_mans += [['nm-settings-ifcfg-rh', '5']]
endif
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
depend_files: common_ent_file,
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
built_mans = []
foreach man: mans + introspection_mans
name = man[0] + '.' + man[1]
if not fs.exists(name)
built_mans = []
break
endif
built_mans += name
endforeach
if enable_introspection
if enable_introspection or enable_docs
common_ent_file = configure_file(
input: 'common.ent.in',
output: '@BASENAME@',
configuration: data_conf,
)
endif
if enable_introspection and (enable_man or enable_docs)
xsltproc_options = [
find_program('xsltproc'),
'--output', '@OUTPUT@',
'--path', meson.current_build_dir(),
'--xinclude',
'--nonet',
'--stringparam', 'man.output.quietly', '1',
'--stringparam', 'funcsynopsis.style', 'ansi',
'--stringparam', 'man.th.extra1.suppress', '1',
'--stringparam', 'man.authors.section.enabled', '0',
'--stringparam', 'man.copyright.section.enabled', '0',
'--stringparam', 'man.th.title.max.length', '30',
]
docbook_xls = 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl'
mans_xmls = []
foreach man: mans
input = man[0] + '.xml'
content_files += join_paths(meson.current_source_dir(), input)
output = '@0@.@1@'.format(man[0], man[1])
# not needed if only html requested
if enable_man
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
depend_files: common_ent_file,
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
endif
endforeach
merge_cmd = files(source_root / 'tools' / 'generate-docs-nm-settings-docs-merge.py')
name = 'dbus'
@ -124,13 +150,23 @@ if enable_introspection
output = '@0@.@1@'.format(man[0], man[1])
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
# not needed if only html requested
if enable_man
custom_target(
output,
input: input,
output: output,
command: xsltproc_options + [docbook_xls, '@INPUT@'],
install: true,
install_dir: join_paths(nm_mandir, 'man' + man[1]),
)
endif
endforeach
# not needed if only html requested
elif enable_man
if built_mans.length() > 0
install_man(built_mans)
else
error('Building manpages requires xsltproc and -Dintrospection=true, and no prebuilt manpages were found. Try building from a release tarball or using -Dman=false.')
endif
endif

View file

@ -115,9 +115,9 @@
<title>nm-cloud-setup.service systemd unit</title>
<para>Usually <command>/usr/libexec/nm-cloud-setup</command> is not run directly,
but only by <command>systemctl restart nm-cloud-setup.service</command>. This
ensures that the tool only runs once at any time. It also allows to integrate
with the nm-cloud-setup systemd timer,
and to enable/disable the service via systemd.</para>
ensures that the tool only runs once at any time.
The unit is also used by the nm-cloud-setup systemd timer and allows
enabling/disabling the service via systemd.</para>
<para>As you need to set environment variable to configure nm-cloud-setup binary,
you can do so via systemd override files. Try <command>systemctl edit nm-cloud-setup.service</command>.</para>

View file

@ -154,6 +154,7 @@
<member><option>net.ifnames</option></member>
<member><option>rd.peerdns</option></member>
<member><option>rd.iscsi.ibft</option></member>
<member><option>rd.nvmf.nonbft</option></member>
<member><option>rd.bootif</option></member>
<member><option>rd.neednet</option></member>
<member><option>rd.ethtool</option></member>
@ -161,6 +162,7 @@
<member><option>rd.net.dns-backend</option></member>
<member><option>rd.net.dns-resolve-mode</option></member>
<member><option>rd.net.timeout.dhcp</option></member>
<member><option>rd.net.dhcp.client-id</option></member>
<member><option>rd.net.dhcp.retry</option></member>
<member><option>rd.net.dhcp.vendor-class</option></member>
<member><option>rd.net.dhcp.dscp</option></member>
@ -267,6 +269,23 @@
</para>
</listitem>
<listitem>
<para>NetworkManager supports the
<option>rd.net.dhcp.client-id</option>=<replaceable>interface</replaceable>:<replaceable>client-id</replaceable>
kernel command line option to set a specific DHCPv4 client identifier
for the given interface. The client-id can be specified either as a
sequence of bytes in hexadecimal format separated by dashes, or as the
character '@' followed by a non-empty string. When using the second
format, NetworkManager prepends a zero byte to the given string,
according to section 9.14 of RFC 2132. See the "ipv4.dhcp-client-id"
section of <link
linkend='nm-settings-nmcli'><citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>
for more details. Examples:
<literal>rd.net.dhcp.client-id=eth0:01-52-54-00-45-87-42</literal>,
<literal>rd.net.dhcp.client-id=enp1s0:@example.com</literal>.
</para>
</listitem>
</itemizedlist>
</refsect1>
@ -277,6 +296,7 @@
<refsect1 id='see_also'><title>See Also</title>
<para><link linkend='dracut.cmdline'><citerefentry><refentrytitle>dracut.cmdline</refentrytitle><manvolnum>7</manvolnum></citerefentry></link>,
<link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>.</para>
<link linkend='NetworkManager'><citerefentry><refentrytitle>NetworkManager</refentrytitle><manvolnum>8</manvolnum></citerefentry></link>,
<link linkend='nm-settings-nmcli'><citerefentry><refentrytitle>nm-settings-nmcli</refentrytitle><manvolnum>5</manvolnum></citerefentry></link>.</para>
</refsect1>
</refentry>

View file

@ -1066,15 +1066,16 @@
<listitem><para><literal>dummy</literal></para></listitem>
<listitem><para><literal>generic</literal></para></listitem>
<listitem><para><literal>gsm</literal></para></listitem>
<listitem><para><literal>hsr</literal></para></listitem>
<listitem><para><literal>infiniband</literal></para></listitem>
<listitem><para><literal>ip-tunnel</literal></para></listitem>
<listitem><para><literal>ipvlan</literal></para></listitem>
<listitem><para><literal>loopback</literal></para></listitem>
<listitem><para><literal>macsec</literal></para></listitem>
<listitem><para><literal>macvlan</literal></para></listitem>
<listitem><para><literal>olpc-mesh</literal></para></listitem>
<listitem><para><literal>ovs-bridge</literal></para></listitem>
<listitem><para><literal>ovs-dpdk</literal></para></listitem>
<listitem><para><literal>ovs-interface</literal></para></listitem>
<listitem><para><literal>ovs-patch</literal></para></listitem>
<listitem><para><literal>ovs-port</literal></para></listitem>
<listitem><para><literal>pppoe</literal></para></listitem>
<listitem><para><literal>team</literal></para></listitem>

View file

@ -5,14 +5,14 @@ project(
# NOTE: When incrementing version also add corresponding
# NM_VERSION_x_y_z macros in
# "src/libnm-core-public/nm-version-macros.h.in"
version: '1.52.2',
version: '1.57.1',
license: 'GPL2+',
default_options: [
'buildtype=debugoptimized',
'c_std=gnu11',
'warning_level=2' # value "2" will add "-Wall" and "-Wextra" to the compiler flags
],
meson_version: '>= 0.51.0',
meson_version: '>= 0.53.0',
)
nm_name = meson.project_name()
@ -77,6 +77,7 @@ libnm_version = '@0@.@1@.@2@'.format(current - age, age, revision)
libnm_pkgincludedir = join_paths(nm_includedir, libnm_name)
fs = import('fs')
gnome = import('gnome')
i18n = import('i18n')
pkg = import('pkgconfig')
@ -89,7 +90,6 @@ po_dir = source_root / 'po'
top_inc = include_directories('.')
perl = find_program('perl')
xsltproc = find_program('xsltproc')
check_exports = find_program(join_paths(source_root, 'tools', 'check-exports.sh'))
@ -137,6 +137,9 @@ config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix:
config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include <string.h>'))
config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include <sys/mman.h>'))
config_h.set10('HAVE_DLVSYM', cc.has_function('dlvsym', prefix: '''#define _GNU_SOURCE
#include <dlfcn.h>'''))
# types
config_h.set('SIZEOF_PID_T', cc.sizeof('pid_t', prefix : '#include <sys/types.h>'))
config_h.set('SIZEOF_UID_T', cc.sizeof('uid_t', prefix : '#include <sys/types.h>'))
@ -173,13 +176,13 @@ endif
enable_lto = get_option('b_lto')
if enable_lto
if cc.get_id() == 'clang'
clang_version = cc.version()
if clang_version <= '18.0.0'
error('Clang version should be greater then 18.0.0 got : ' + clang_version)
cc_version = cc.version()
if cc.get_id() == 'clang'
if cc_version <= '18.0.0'
error('Clang version should be greater than 18.0.0, got : ' + cc_version)
endif
else
# Meson already adds '-flto'
elif cc_version < '12.0'
# GCC < 12 breaks libnm symbol versioning with LTO, use workarounds
lto_flag = '-flto-partition=none'
assert(cc.has_argument(lto_flag), '-flto-partition=none not supported. Disable link-time optimization with -Db_lto=false.')
common_flags += lto_flag
@ -324,12 +327,17 @@ config_h.set10('WITH_CONFIG_PLUGIN_IFUPDOWN', enable_ifupdown)
config_h.set_quoted('NM_DIST_VERSION', dist_version)
enable_wifi = get_option('wifi')
config_h.set10('WITH_WIFI', enable_wifi)
enable_iwd = get_option('iwd')
assert((not enable_iwd) or enable_wifi, 'Enabling iwd support requires Wi-Fi support as well')
config_h.set10('WITH_IWD', enable_iwd)
enable_wext = get_option('wext')
wext = get_option('wext')
if wext == 'true'
error('Wireless Extensions support is deprecated and will be removed in the future. Use -Dwext=force to keep using it')
endif
enable_wext = (wext == 'force')
config_h.set10('HAVE_WEXT', enable_wext)
# Checks for libdl - on certain platforms its part of libc
@ -379,6 +387,14 @@ if install_systemdunitdir and systemd_systemdsystemunitdir == ''
systemd_systemdsystemunitdir = systemd_dep.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define: ['rootprefix', nm_prefix])
endif
systemd_systemdsystemgeneratordir = get_option('systemdsystemgeneratordir')
install_systemdgeneratordir = (systemd_systemdsystemgeneratordir != 'no')
if install_systemdgeneratordir and systemd_systemdsystemgeneratordir == ''
assert(systemd_dep.found(), 'systemd required but not found, please provide a valid systemd user generator dir or disable it')
systemd_systemdsystemgeneratordir = systemd_dep.get_variable(pkgconfig: 'systemdsystemgeneratordir', pkgconfig_define: ['rootprefix', nm_prefix])
endif
enable_systemd_journal = get_option('systemd_journal')
if enable_systemd_journal
assert(libsystemd_dep.found(), 'Missing systemd-journald support')
@ -473,19 +489,6 @@ if enable_selinux
endif
config_h.set10('HAVE_SELINUX', enable_selinux)
# eBPF support
ebpf_opt = get_option('ebpf')
# 'auto' means 'false', because there are still issues.
if ebpf_opt != 'true'
enable_ebpf = false
else
enable_ebpf = true
if not cc.has_header('linux/bpf.h')
assert(ebpf_opt != 'true', 'eBPF requires kernel support')
enable_ebpf = false
endif
endif
# libaudit support
libaudit = get_option('libaudit')
enable_libaudit = libaudit.contains('yes')
@ -504,12 +507,14 @@ if enable_teamdctl
libteamdctl_dep = dependency('libteamdctl', version: '>= 1.9')
assert(libteamdctl_dep.found(), 'You must have libteamdctl installed to build. Use -Dteamdctl=false to disable it')
endif
config_h.set10('WITH_TEAMDCTL', enable_teamdctl)
# polkit
enable_polkit = get_option('polkit')
if enable_polkit
# FIXME: policydir should be relative to `datadir`, not `prefix`. Fixed in https://gitlab.freedesktop.org/polkit/polkit/merge_requests/2
polkit_gobject_policydir = dependency('polkit-gobject-1').get_variable(pkgconfig: 'policydir', pkgconfig_define: ['prefix', nm_prefix])
polkit_policydir = dependency('polkit-gobject-1').get_variable(pkgconfig: 'policydir', pkgconfig_define: ['prefix', nm_prefix])
polkit_rulesdir = join_paths(fs.parent(polkit_policydir), 'rules.d')
endif
config_auth_polkit_default = get_option('config_auth_polkit_default')
@ -519,6 +524,12 @@ endif
config_h.set_quoted('NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT', config_auth_polkit_default)
enable_modify_system = get_option('modify_system')
if enable_modify_system
# FIXME: remove this after everyone has stopped using modify_system
error('modify_system=true is no longer allowed due to security reasons')
endif
polkit_noauth_group = get_option('polkit_noauth_group')
polkit_agent_helper_1_path = get_option('polkit_agent_helper_1')
foreach p : [ '/usr/libexec/polkit-agent-helper-1',
@ -613,6 +624,7 @@ if enable_modem_manager
endif
config_h.set_quoted('MOBILE_BROADBAND_PROVIDER_INFO_DATABASE', mobile_broadband_provider_info_database)
endif
config_h.set10('WITH_WWAN', enable_modem_manager)
# Bluez5 DUN support
enable_bluez5_dun = get_option('bluez5_dun')
@ -813,6 +825,7 @@ if enable_nm_cloud_setup
assert(jansson_dep.found(), 'nm-cloud-setup requires jansson library. Use -Dnm_cloud_setup=false to disable it')
endif
enable_man = get_option('man')
enable_docs = get_option('docs')
more_asserts = get_option('more_asserts')
@ -911,7 +924,6 @@ endif
test_args = [
'--called-from-make',
build_root,
'',
enable_valgrind ? valgrind_path : '',
enable_valgrind ? valgrind_suppressions_path : '',
'--launch-dbus=auto',
@ -929,6 +941,14 @@ if python.found()
config_h.set_quoted('TEST_NM_PYTHON', python_path)
endif
# libnvme (NBFT support)
enable_nbft = get_option('nbft')
if enable_nbft
libnvme_dep = dependency('libnvme', version: '>= 1.5', required: false)
assert(libnvme_dep.found(), 'NBFT support was requested, but the libnvme library is not available. Use -Dnbft=false to build without it.')
endif
config_h.set10('WITH_NBFT', enable_nbft)
data_conf = configuration_data()
data_conf.set('DISTRO_NETWORK_SERVICE', (enable_ifcfg_rh ? 'network.service' : ''))
data_conf.set('NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT', config_default_logging_audit)
@ -942,7 +962,6 @@ data_conf.set('NM_DHCP_CLIENTS_ENABLED', ', '.join(config_dhcp_c
data_conf.set('NM_MAJOR_VERSION', nm_major_version)
data_conf.set('NM_MICRO_VERSION', nm_micro_version)
data_conf.set('NM_MINOR_VERSION', nm_minor_version)
data_conf.set('NM_MODIFY_SYSTEM_POLICY', (enable_modify_system ? 'yes' : 'auth_admin_keep'))
data_conf.set('NM_VERSION', nm_version)
data_conf.set('VERSION', nm_version)
data_conf.set('bindir', nm_bindir)
@ -953,38 +972,6 @@ data_conf.set('nmstatedir', nm_pkgstatedir)
data_conf.set('sbindir', nm_sbindir)
data_conf.set('sysconfdir', nm_sysconfdir)
# check if we can build setting property documentation
'''
build_docs=no
if test -n "$INTROSPECTION_MAKEFILE"; then
# If g-i is installed we know we have python, but we might not have pygobject
if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then
AC_MSG_ERROR(["--enable-introspection aims to build the settings documentation. This requires GObject introspection for python (pygobject)])
fi
AC_PATH_PROG(PERL, perl)
if test -z "$PERL"; then
AC_MSG_ERROR([--enable-introspection requires perl])
fi
AC_PATH_PROG(XSLTPROC, xsltproc)
if test -z "$XSLTPROC"; then
AC_MSG_ERROR([--enable-introspection requires xsltproc])
fi
have_introspection=yes
if test "$enable_gtk_doc" = "yes"; then
build_docs=yes
fi
else
if test "$enable_gtk_doc" = "yes"; then
# large parts of the documentation require introspection/pygobject to extract
# the documentation out of the source files. You cannot enable gtk-doc without alone.
AC_MSG_ERROR(["--with-gtk-doc requires --enable-introspection"])
fi
have_introspection=no
fi
'''
content_files = []
subdir('introspection')
@ -1022,9 +1009,14 @@ if enable_qt != 'false'
endif
endif
# The man/ directory builds a couple targets needed by the docs build too.
# If we build with docs but no man, then enter the subdir and only build
# some targets.
if enable_docs or enable_man
subdir('man')
endif
if enable_docs
assert(enable_introspection, '-Ddocs=true requires -Dintrospection=true')
subdir('man')
subdir('docs')
meson.add_dist_script(
'tools/meson-dist-data.sh',
@ -1075,7 +1067,7 @@ meson.add_install_script(
nm_pkgstatedir,
nm_mandir,
nm_sysconfdir,
enable_docs ? '1' : '0',
enable_man ? '1' : '0',
enable_ifcfg_rh ? '1' : '0',
enable_nm_cloud_setup ? '1' : '0',
install_systemdunitdir ? '1' : '0',
@ -1085,6 +1077,7 @@ output = '\nSystem paths:\n'
output += ' prefix: ' + nm_prefix + '\n'
output += ' exec_prefix: ' + nm_prefix + '\n'
output += ' systemdunitdir: ' + systemd_systemdsystemunitdir + '\n'
output += ' systemdgeneratordir: ' + systemd_systemdsystemgeneratordir + '\n'
output += ' udev_dir: ' + udev_udevdir + '\n'
output += ' nmbinary: ' + nm_pkgsbindir + '\n'
output += ' nmconfdir: ' + nm_pkgconfdir + '\n'
@ -1099,17 +1092,7 @@ output += ' dbus_conf_dir: ' + dbus_conf_dir + '\n'
output += '\nPlatform:\n'
output += ' session tracking: ' + ','.join(session_trackers) + '\n'
output += ' suspend/resume: ' + suspend_resume + '\n'
output += ' policykit: ' + enable_polkit.to_string() + ' (default: ' + config_auth_polkit_default + ')'
if enable_polkit
output += ' ('
if enable_modify_system
output += 'permissive'
else
output += 'restrictive'
endif
output += ' modify.system)'
endif
output += '\n'
output += ' policykit: ' + enable_polkit.to_string() + ' (default: ' + config_auth_polkit_default + ', noauth_group: "' + polkit_noauth_group + '")\n'
output += ' polkit-agent-helper-1: ' + polkit_agent_helper_1_path + '\n'
output += ' selinux: ' + enable_selinux.to_string() + '\n'
output += ' systemd-journald: ' + enable_systemd_journal.to_string() + ' (default: logging.backend=' + config_logging_backend_default + ')\n'
@ -1173,6 +1156,5 @@ output += 'have-nss: ' + crypto_nss_dep.found().to_string() + ')\n'
output += ' sanitizers: ' + get_option('b_sanitize') + '\n'
output += ' Mozilla Public Suffix List: ' + enable_libpsl.to_string() + '\n'
output += ' vapi: ' + enable_vapi.to_string() + '\n'
output += ' ebpf: ' + enable_ebpf.to_string() + '\n'
output += ' readline: ' + with_readline + '\n'
message(output)

View file

@ -1,5 +1,6 @@
# system paths
option('systemdsystemunitdir', type: 'string', value: '', description: 'Directory for systemd service files')
option('systemdsystemgeneratordir', type: 'string', value: '', description: 'Directory for systemd generator files')
option('system_ca_path', type: 'string', value: '/etc/ssl/certs', description: 'path to system CA certificates')
option('udev_dir', type: 'string', value: '', description: 'Absolute path of the udev base directory. Set to \'no\' not to install the udev rule')
option('dbus_conf_dir', type: 'string', value: '', description: 'where D-Bus system.d directory is')
@ -18,7 +19,8 @@ option('session_tracking', type: 'combo', choices: ['systemd', 'elogind', 'no'],
option('suspend_resume', type: 'combo', choices: ['systemd', 'elogind', 'consolekit', 'auto'], value: 'auto', description: 'Build NetworkManager with specific suspend/resume support')
option('polkit', type: 'boolean', value: true, description: 'User auth-polkit configuration option.')
option('config_auth_polkit_default', type: 'combo', choices: ['default', 'true', 'false', 'root-only'], value: 'default', description: 'Default value for configuration main.auth-polkit.')
option('modify_system', type: 'boolean', value: false, description: 'Allow users to modify system connections')
option('modify_system', type: 'boolean', value: false, description: 'Allow users to modify system connections (option no longer supported, don\'t use)')
option('polkit_noauth_group', type: 'string', value: '', description: 'Allow users of the selected group, typically sudo or wheel, to modify system connections without introducing a password (discouraged)')
option('polkit_agent_helper_1', type: 'string', value: '', description: 'Path name to the polkit-agent-helper-1 binary from polkit')
option('selinux', type: 'boolean', value: true, description: 'Build with SELinux')
option('systemd_journal', type: 'boolean', value: true, description: 'Use systemd journal for logging')
@ -28,7 +30,7 @@ option('hostname_persist', type: 'combo', choices: ['default', 'suse', 'gentoo',
option('libaudit', type: 'combo', choices: ['yes', 'yes-disabled-by-default', 'no'], value: 'yes', description: 'Build with audit daemon support. yes-disabled-by-default enables support, but disables it unless explicitly configured via NetworkManager.conf')
# features
option('wext', type: 'boolean', value: true, description: 'Enable or disable Linux Wireless Extensions')
option('wext', type: 'combo', choices: ['true', 'false', 'force' ], value: 'false', description: 'Enable or disable Linux Wireless Extensions (deprecated). wext support will be removed in a future release, don\'t rely on this.')
option('wifi', type: 'boolean', value: true, description: 'enable Wi-Fi support')
option('iwd', type: 'boolean', value: false, description: 'enable iwd support (experimental)')
option('ppp', type: 'boolean', value: true, description: 'enable PPP/PPPoE support')
@ -44,7 +46,8 @@ option('nmcli', type: 'boolean', value: true, description: 'Build nmcli')
option('nmtui', type: 'boolean', value: true, description: 'Build nmtui')
option('nm_cloud_setup', type: 'boolean', value: true, description: 'Build nm-cloud-setup, a tool for automatically configuring networking in cloud')
option('bluez5_dun', type: 'boolean', value: false, description: 'enable Bluez5 DUN support')
option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support')
option('ebpf', type: 'combo', choices: ['auto', 'true', 'false'], description: 'Enable eBPF support (deprecated)')
option('nbft', type: 'boolean', value: true, description: 'Enable NBFT support in the initrd generator')
# configuration plugins
option('config_plugins_default', type: 'string', value: '', description: 'Default configuration option for main.plugins setting, used as fallback if the configuration option is unset')
@ -66,6 +69,7 @@ option('config_dhcp_default', type: 'combo', choices: ['dhclient', 'dhcpcd', 'in
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
option('vapi', type : 'combo', choices : ['auto', 'true', 'false'], description: 'build Vala bindings')
option('docs', type: 'boolean', value: false, description: 'use to build documentation')
option('man', type: 'boolean', value: true, description: 'Install manpages')
option('tests', type: 'combo', choices: ['yes', 'no', 'root'], value: 'yes', description: 'Build NetworkManager tests')
option('firewalld_zone', type: 'boolean', value: true, description: 'Install and use firewalld zone for shared mode')
option('more_asserts', type: 'string', value: 'auto', description: 'Enable more assertions for debugging (0 = no, 100 = all, default: auto)')

View file

@ -1,6 +1,6 @@
# List of source files containing translatable strings.
# Please keep this file sorted alphabetically.
data/org.freedesktop.NetworkManager.policy.in.in
data/org.freedesktop.NetworkManager.policy.in
src/core/NetworkManagerUtils.c
src/core/devices/adsl/nm-device-adsl.c
src/core/devices/bluetooth/nm-bluez-manager.c
@ -95,6 +95,7 @@ src/libnm-core-impl/nm-setting-hsr.c
src/libnm-core-impl/nm-setting-infiniband.c
src/libnm-core-impl/nm-setting-ip-config.c
src/libnm-core-impl/nm-setting-ip-tunnel.c
src/libnm-core-impl/nm-setting-ipvlan.c
src/libnm-core-impl/nm-setting-ip4-config.c
src/libnm-core-impl/nm-setting-ip6-config.c
src/libnm-core-impl/nm-setting-loopback.c
@ -148,6 +149,7 @@ src/libnmc-base/nm-secret-agent-simple.c
src/libnmc-base/nm-vpn-helpers.c
src/libnmc-setting/nm-meta-setting-access.c
src/libnmc-setting/nm-meta-setting-desc.c
src/libnmc-setting/nm-meta-setting-desc.h
src/libnmc-setting/settings-docs.h.in
src/libnmt-newt/nmt-newt-utils.c
src/nm-online/nm-online.c
@ -179,6 +181,7 @@ src/nmtui/nmt-page-infiniband.c
src/nmtui/nmt-page-ip-tunnel.c
src/nmtui/nmt-page-ip4.c
src/nmtui/nmt-page-ip6.c
src/nmtui/nmt-page-loopback.c
src/nmtui/nmt-page-macsec.c
src/nmtui/nmt-page-ppp.c
src/nmtui/nmt-page-team-port.c

View file

@ -1,20 +1,11 @@
contrib/fedora/rpm/
data/NetworkManager-dispatcher.service.in
data/NetworkManager-wait-online.service.in
data/NetworkManager-wait-online-initrd.service.in
data/NetworkManager-initrd.service.in
data/NetworkManager.service.in
data/nm-priv-helper.service.in
data/org.freedesktop.NetworkManager.policy.in
examples/python/NetworkManager.py
examples/python/systray/eggtrayicon.c
src/contrib/nm-vpn-editor-plugin-call.h
src/contrib/nm-vpn-plugin-utils.c
src/libnm-systemd-shared/src/basic/parse-util.c
src/nm-cloud-setup/nm-cloud-setup.service.in
vpn-daemons/openvpn
vpn-daemons/pptp
vpn-daemons/vpnc
# https://bugs.launchpad.net/intltool/+bug/1117944
sub/data/org.freedesktop.NetworkManager.policy.in
# from meson build directory:
build/data/org.freedesktop.NetworkManager.policy.in

View file

@ -8,14 +8,15 @@
# Lubomir Rintel <lkundrak@v3.sk>, 2016. #zanata
# Lubomir Rintel <lkundrak@v3.sk>, 2017. #zanata
# Thomas Haller <thaller@redhat.com>, 2017. #zanata
# Jordi Mas i Hernàndez <jmas@softcatala.org>, 2025
msgid ""
msgstr ""
"Project-Id-Version: NetworkManager\n"
"Report-Msgid-Bugs-To: https://gitlab.freedesktop.org/NetworkManager/"
"NetworkManager/issues\n"
"POT-Creation-Date: 2023-06-16 15:26+0000\n"
"PO-Revision-Date: 2023-06-17 00:07+0200\n"
"Last-Translator: Copied by Zanata <copied-by-zanata@zanata.org>\n"
"PO-Revision-Date: 2025-09-28 00:07+0200\n"
"Last-Translator: Jordi Mas i Hernàndez <jmas@softcatala.org>\n"
"Language-Team: Catalan <tradgnome@softcatala.org>\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
@ -355,7 +356,7 @@ msgstr "Connexió WPAN"
#: src/core/devices/team/nm-device-team.c:131
msgid "Team connection"
msgstr "Connexió equip"
msgstr "Connexió d'equip"
#: src/core/devices/wifi/nm-device-olpc-mesh.c:112 src/nmcli/devices.c:1400
msgid "Mesh"
@ -648,7 +649,7 @@ msgstr "Surt després de la configuració inicial"
#: src/core/nm-config.c:639
msgid "Don't become a daemon, and log to stderr"
msgstr ""
"No et converteixis en un dimoni, i envia el registre a la sortida estàndard"
"No et converteixis en un dimoni, i envia el registre a la sortida d'error"
#: src/core/nm-config.c:648
msgid "An http(s) address for checking internet connectivity"
@ -795,7 +796,7 @@ msgstr "La connexió no era una connexió Ethernet o PPPoE."
#: src/libnm-client-impl/nm-device-ethernet.c:206
msgid "The connection and device differ in S390 subchannels."
msgstr "La connexió i el dispositiu difereixen als subcanals 5930."
msgstr "La connexió i el dispositiu difereixen als subcanals S390."
#: src/libnm-client-impl/nm-device-ethernet.c:223
#, c-format
@ -881,7 +882,7 @@ msgstr "La connexió no era una connexió tun."
#: src/libnm-client-impl/nm-device-team.c:124
msgid "The connection was not a team connection."
msgstr "La connexió no era una connexió equip."
msgstr "La connexió no era una connexió d'equip."
#: src/libnm-client-impl/nm-device-tun.c:204
msgid "The connection was not a tun connection."
@ -1325,27 +1326,27 @@ msgstr ""
#: src/libnm-core-impl/nm-keyfile.c:333
msgid "ignoring missing number"
msgstr "s'ignora el número faltant"
msgstr "s'ignora el número faltant"
#: src/libnm-core-impl/nm-keyfile.c:345
#, c-format
msgid "ignoring invalid number '%s'"
msgstr "s'ignora el número «%s» no vàlid"
msgstr "s'ignora el número «%s» no vàlid"
#: src/libnm-core-impl/nm-keyfile.c:374
#, c-format
msgid "ignoring invalid %s address: %s"
msgstr "s'ignora l'adreça %s no vàlida: %s"
msgstr "s'ignora l'adreça %s no vàlida: %s"
#: src/libnm-core-impl/nm-keyfile.c:420
#, c-format
msgid "ignoring invalid gateway '%s' for %s route"
msgstr "s'ignora la passarel·la «%s» no vàlida per a la ruta %s"
msgstr "s'ignora la passarel·la «%s» no vàlida per a la ruta %s"
#: src/libnm-core-impl/nm-keyfile.c:442
#, c-format
msgid "ignoring invalid %s route: %s"
msgstr "s'ignora la ruta %s no vàlida: %s"
msgstr "s'ignora la ruta %s no vàlida: %s"
#: src/libnm-core-impl/nm-keyfile.c:620
#, c-format
@ -1361,7 +1362,7 @@ msgstr "caràcter «%c» inesperat per a %s: «%s» (posició %td)"
#, c-format
msgid "unexpected character '%c' in prefix length for %s: '%s' (position %td)"
msgstr ""
"caràcter «%c» inesperat a la longitud de prefix %s: «%s» (posició %td)<"
"caràcter «%c» inesperat a la longitud de prefix %s: «%s» (posició %td)"
#: src/libnm-core-impl/nm-keyfile.c:669
#, c-format
@ -1413,11 +1414,11 @@ msgstr "s'ignorarà l'adreça %s no vàlida: %s"
#: src/libnm-core-impl/nm-keyfile.c:1518
msgid "ignoring invalid SSID"
msgstr "s'ignora l'SSID no vàlida"
msgstr "s'ignora l'SSID no vàlida"
#: src/libnm-core-impl/nm-keyfile.c:1536
msgid "ignoring invalid raw password"
msgstr "s'ignora la contrasenya sense processar no vàlida"
msgstr "s'ignora la contrasenya sense processar no vàlida"
#: src/libnm-core-impl/nm-keyfile.c:1681
msgid "invalid key/cert value"
@ -1458,7 +1459,7 @@ msgstr "valor de paritat «%s» no vàlid"
#: src/libnm-core-impl/nm-keyfile.c:1958 src/libnm-core-impl/nm-keyfile.c:3540
#, c-format
msgid "invalid setting: %s"
msgstr "el paràmetre no és vàlid: «%s»"
msgstr "el paràmetre no és vàlid: %s"
#: src/libnm-core-impl/nm-keyfile.c:1978
#, fuzzy, c-format
@ -1973,7 +1974,7 @@ msgstr "file:// URI no és UTF-8 vàlida"
#: src/libnm-core-impl/nm-setting-connection.c:1501
msgid "invalid permissions not in format \"user:$UNAME[:]\""
msgstr "els permisos no són vàlids, no estan en el format «user:$UNANE[:]"
msgstr "els permisos no són vàlids, no estan en el format «user:$UNAME[:]"
#: src/libnm-core-impl/nm-setting-connection.c:1530
#, c-format
@ -2086,7 +2087,7 @@ msgstr "«%s» no és un número"
#: src/libnm-core-impl/nm-setting-gsm.c:479
msgid "property is empty or wrong size"
msgstr "la propietat és buda o de mida incorrecta"
msgstr "la propietat és buida o de mida incorrecta"
#: src/libnm-core-impl/nm-setting-gsm.c:492
msgid "property must contain only digits"
@ -2098,12 +2099,12 @@ msgstr "no es pot activar quan hi ha una configuració manual"
#: src/libnm-core-impl/nm-setting-infiniband.c:215
msgid "Must specify a P_Key if specifying parent"
msgstr "S'ha d'especificar una P-Key si s'especifica el pare"
msgstr "S'ha d'especificar una P_Key si s'especifica el pare"
#: src/libnm-core-impl/nm-setting-infiniband.c:226
msgid "InfiniBand P_Key connection did not specify parent interface name"
msgstr ""
"La connexió InfiniBand P_Key no ha especificat el nom de l'interfície pare"
"La connexió InfiniBand P_Key no ha especificat el nom de la interfície pare"
#: src/libnm-core-impl/nm-setting-infiniband.c:234
msgid "the values 0 and 0x8000 are not allowed"
@ -2156,12 +2157,12 @@ msgstr "Adreça IPv4 «%s» no és vàlida"
#: src/libnm-core-impl/nm-setting-ip-config.c:106
#, c-format
msgid "Invalid IPv4 address prefix '%u'"
msgstr "Prefix «%u» d'adreça IPv4 no vàlida"
msgstr "Prefix «%u» d'adreça IPv4 no vàlid"
#: src/libnm-core-impl/nm-setting-ip-config.c:107
#, c-format
msgid "Invalid IPv6 address prefix '%u'"
msgstr "Prefix «%u» d'adreça IPv6 no vàlida<"
msgstr "Prefix «%u» d'adreça IPv6 no vàlid"
#: src/libnm-core-impl/nm-setting-ip-config.c:124
#, c-format
@ -2208,7 +2209,7 @@ msgstr "el prefix %s no és vàlid"
#: src/libnm-core-impl/nm-setting-ip-config.c:1423
#, c-format
msgid "%s is not a valid route type"
msgstr "%s no és un nom de ruta vàlid"
msgstr "%s no és un tipus de ruta vàlid"
#: src/libnm-core-impl/nm-setting-ip-config.c:1442
#, fuzzy
@ -2432,7 +2433,7 @@ msgstr "La ruta %d. no és vàlida"
#: src/libnm-core-impl/nm-setting-ip-config.c:5638
#, c-format
msgid "invalid attribute: %s"
msgstr "atribut no vàlid: «%s»"
msgstr "atribut no vàlid: %s"
#: src/libnm-core-impl/nm-setting-ip-config.c:5658
#, c-format
@ -4105,7 +4106,7 @@ msgstr "«%s» no és vàlid; useu [%s] or [%s]"
#: src/libnmc-base/nm-client-utils.c:176
#, c-format
msgid "'%s' is not valid; use [%s], [%s] or [%s]"
msgstr "«%s» no és vàld, useu [%s], [%s] o [%s]"
msgstr "«%s» no és vàlid, useu [%s], [%s] o [%s]"
#: src/libnmc-base/nm-client-utils.c:230
#, c-format
@ -4676,7 +4677,7 @@ msgstr "clau privada no vàlida"
#, fuzzy, c-format
msgid "Secrets are required to connect WireGuard VPN '%s'"
msgstr ""
"Es requereixen contrasenyes o claus d'encriptació per accedir la xarxa sens "
"Es requereixen contrasenyes o claus d'encriptació per accedir la xarxa sense "
"fil «%s»."
#: src/libnmc-base/nm-secret-agent-simple.c:620
@ -4698,7 +4699,7 @@ msgid ""
"Passwords or encryption keys are required to access the wireless network "
"'%s'."
msgstr ""
"Es requereixen contrasenyes o claus d'encriptació per accedir la xarxa sens "
"Es requereixen contrasenyes o claus d'encriptació per accedir la xarxa sense "
"fil «%s»."
#: src/libnmc-base/nm-secret-agent-simple.c:886
@ -4709,7 +4710,7 @@ msgstr "Autenticació 802.1X de xarxa amb fil"
#, fuzzy, c-format
msgid "Secrets are required to access the wired network '%s'"
msgstr ""
"Es requereixen contrasenyes o claus d'encriptació per accedir la xarxa sens "
"Es requereixen contrasenyes o claus d'encriptació per accedir la xarxa sense "
"fil «%s»."
#: src/libnmc-base/nm-secret-agent-simple.c:893
@ -5418,10 +5419,10 @@ msgid ""
msgstr ""
"Entreu els bytes com una llista de valors hexadecimals.\n"
"S'accepten dos formats:\n"
"(a) una cadena de dígits exadecimals, on cada dos dígits representen un "
"(a) una cadena de dígits hexadecimals, on cada dos dígits representen un "
"byte\n"
"(b) una llista separada per espais de bytes escrits com a dígits hexadecimas "
"(amb prefix opcional 0x/0X,i un 0 inicial opcional). \n"
"(b) una llista separada per espais de bytes escrits com a dígits hexadecimals "
"(amb prefix opcional 0x/0X,i un 0 inicial opcional).\n"
"\n"
"Exemples: ab0455a6ea3a74C2\n"
" ab 4 55 0xa6 ea 3a 74 C2\n"
@ -5493,7 +5494,7 @@ msgstr "Demora cap endavant"
#: src/libnmc-setting/nm-meta-setting-desc.c:5280
#: src/nmtui/nmt-page-bridge.c:134
msgid "Hello time"
msgstr "Temps de benviguda"
msgstr "Temps de benvinguda"
#: src/libnmc-setting/nm-meta-setting-desc.c:5286
#: src/nmtui/nmt-page-bridge.c:148
@ -5567,7 +5568,7 @@ msgid ""
msgstr ""
"Entreu les connexions secundàries que s'haurien d'activar quan s'activa "
"aquesta connexió. Les connexions es poden especificar o bé per UUID o per ID "
"(nom). L'nmcli tradueix transparentment els noms a UUID. Noteu que el "
"(nom). nmcli tradueix transparentment els noms a UUID. Noteu que el "
"NetworkManager actualment sols dóna suport els VPN com a connexions "
"secundàries.\n"
"Els elements es poden separar per comes o espais.\n"
@ -5676,7 +5677,7 @@ msgid ""
" priority [prio] [from [src]] [to [dst]], ,...\n"
"\n"
msgstr ""
"Introduïu una llista de regles d'encaminanent IPv4 amb el següent format:\n"
"Introduïu una llista de regles d'encaminament IPv4 amb el següent format:\n"
" priority [prioritat] [from [origen]] [to [destí]], ,...\n"
"\n"
"\n"
@ -5696,7 +5697,7 @@ msgstr ""
"configuració IPv6 \n"
"és «auto» aquests servidors DNS s'annexen als que retorna (si retorna cap) "
"la \n"
"configuració automatica. Els servidors DNS no es poden usar amb els métodes "
"configuració automàtica. Els servidors DNS no es poden usar amb els mètodes "
"de \n"
"configuracó DNS «shared» o «link-local», atès que no hi una xarxa superior. "
"A tots\n"
@ -8151,12 +8152,12 @@ msgstr ""
"canonada (|) o un ampersand (&). El primer indica que l'element és opcional "
"i el segon significa que és obligatori. Si hi ha algun element opcional, "
"llavors la coincidència avalua a cert si almenys un dels elements opcionals "
"coincideix (O lògicà). Si hi ha elements obligatoris, llavors tots han de "
"coincideix (O lògica). Si hi ha elements obligatoris, llavors tots han de "
"coincidir (I lògica). Per defecte, un element és opcional. Això significa "
"que un element «foo» es comporta igual que «|foo». Un element també es pot "
"invertir amb el símbol d'exclamació (!) entre el símbol de la canonada (o de "
"l'ampersand) i abans del patró. Tingueu en compte que «!foo» és una drecera "
"per al patró obligatòri «&!foo». Finalment, es pot utilitzar una barra "
"per al patró obligatori «&!foo». Finalment, es pot utilitzar una barra "
"inversa al començament de l'element (després dels caràcters especials "
"opcionals) per no considerar-lo inici del patró. Per exemple, «\\!a» és una "
"coincidència obligatòria per literalment «!a»."
@ -10722,7 +10723,7 @@ msgstr "Error: «%s» no és una connexió activa.\n"
#: src/nmcli/connections.c:3436
msgid "Error: not all active connections found."
msgstr "Error: No s'han trobar totes les connexions actives."
msgstr "Error: No s'han trobat totes les connexions actives."
#: src/nmcli/connections.c:3444
msgid "Error: no active connection provided."
@ -11041,7 +11042,7 @@ msgstr ""
"Verifica si el paràmetre o la connexió és vàlida i es pot desar més tard.\n"
"Indica valors no vàlids quan hi ha un error. Alguns errors es poden "
"corregir\n"
"automàticaent amb l'opció «fix».\n"
"automàticament amb l'opció «fix».\n"
"\n"
"Exemples: nmcli> verify\n"
" nmcli> verify fix\n"
@ -11063,7 +11064,7 @@ msgid ""
msgstr ""
"save [persistent|temporary] :: desa la connexió\n"
"\n"
"Envia el perfil de la connexió al NetworManager que o bé la desarà de forma\n"
"Envia el perfil de la connexió al NetworkManager que o bé la desarà de forma\n"
"persistent o bé sols la mantindrà a la memòria. «desa» sense cap argument\n"
"significa «desa de forma persistent».\n"
"Noteu que un cop que deseu el perfile de forma persistent aquestes "
@ -11485,7 +11486,7 @@ msgstr "Opció no vàlida de verificació: %s\n"
#: src/nmcli/connections.c:8486
#, c-format
msgid "Verify setting '%s': %s\n"
msgstr "Verifica el paràmere «%s»: %s\n"
msgstr "Verifica el paràmetre «%s»: %s\n"
#: src/nmcli/connections.c:8501
#, c-format
@ -11552,12 +11553,12 @@ msgstr "Error: no es pot activar la connexió: %s.\n"
#: src/nmcli/connections.c:8679
#, c-format
msgid "Error: Failed to activate '%s' (%s) connection: %s\n"
msgstr "Error: no s'ha pogut desconnectar la connexió «%s» (%s): %s\n"
msgstr "Error: no s'ha pogut activar la connexió «%s» (%s): %s\n"
#: src/nmcli/connections.c:8686
msgid "Monitoring connection activation (press any key to continue)\n"
msgstr ""
"S'està supervisant l'activació de la connexio (premeu qualsevol teclar per "
"S'està supervisant l'activació de la connexió (premeu qualsevol tecla per "
"continuar)\n"
#: src/nmcli/connections.c:8721
@ -11582,7 +11583,7 @@ msgstr "Configuració actual del nmcli:\n"
#: src/nmcli/connections.c:8753
#, c-format
msgid "Invalid configuration option '%s'; allowed [%s]\n"
msgstr "Opció de configuració no vàida: «%s»; es permet [%s]\n"
msgstr "Opció de configuració no vàlida: «%s»; es permet [%s]\n"
#: src/nmcli/connections.c:8985
#, fuzzy
@ -12396,7 +12397,7 @@ msgstr "Error: no s'ha pogut afegir/activar la connexió nova: %s"
#: src/nmcli/devices.c:2266
#, c-format
msgid "Error: Device activation failed: %s"
msgstr "Error: no s'ha pogut activar el dispositu: %s"
msgstr "Error: no s'ha pogut activar el dispositiu: %s"
#: src/nmcli/devices.c:2322
#, c-format
@ -12603,7 +12604,7 @@ msgstr "Contrasenya: "
#: src/nmcli/devices.c:4172
#, c-format
msgid "'%s' is not valid WPA PSK"
msgstr "«%s» no és una WPS PSK vàlida"
msgstr "«%s» no és una WPA PSK vàlida"
#: src/nmcli/devices.c:4193
#, c-format
@ -13538,7 +13539,7 @@ msgstr "Error: s'esperava l'argument «%s», però s'ha proporcionat «%s»."
#: src/nmcli/utils.c:315
#, c-format
msgid "Error: Unexpected argument '%s'"
msgstr "Error: argument inesperat «%s»."
msgstr "Error: argument inesperat «%s»"
#: src/nmcli/utils.c:702
#, fuzzy, c-format
@ -13897,7 +13898,7 @@ msgstr "«%s» <"
#. NB: the ordering/numbering here corresponds to NmtPageBondMonitoringMode
#: src/nmtui/nmt-page-bond.c:92
msgid "MII (recommended)"
msgstr "MII (recomendat)"
msgstr "MII (recomanat)"
#: src/nmtui/nmt-page-bond.c:93
msgid "ARP"
@ -14543,7 +14544,7 @@ msgstr ""
#: src/nmtui/nmtui-edit.c:394 src/nmtui/nmtui-edit.c:410
msgid "New Connection"
msgstr "Connexions nova"
msgstr "Connexió nova"
#: src/nmtui/nmtui-edit.c:452
#, c-format

View file

@ -12596,7 +12596,7 @@ msgstr "Digitare «help» o «?» per i comandi disponibili."
#. TRANSLATORS: do not translate 'print', leave it as it is
#: src/nmcli/connections.c:9072
msgid "Type 'print' to show all the connection properties."
msgstr "Digitare «stampa» per mostrare tutte le proprietà della connessione."
msgstr "Digitare «print» per mostrare tutte le proprietà della connessione."
#. TRANSLATORS: do not translate 'describe', leave it as it is
#: src/nmcli/connections.c:9075

5686
po/ka.po

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
i18n.gettext(nm_name, preset: 'glib')
test(
'check-potfile-list',
find_program(join_paths(source_root, 'src/tests/check-potfile-list.py'))
)

File diff suppressed because it is too large Load diff

4795
po/ru.po

File diff suppressed because it is too large Load diff

368
po/sk.po

File diff suppressed because it is too large Load diff

11275
po/sl.po

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@
*
* This uses the NMVpnEditorPluginVT and allows a user (nm-applet)
* to directly communicate with a VPN plugin using API that is newer
* then the current libnm version. That is, it allows to call to a VPN
* then the current libnm version. That is, it allows a user to call to a VPN
* plugin bypassing libnm. */
#include <NetworkManager.h>

View file

@ -155,3 +155,33 @@ nm_vpn_plugin_utils_load_editor(const char *module_path,
g_return_val_if_fail(NM_IS_VPN_EDITOR(editor), NULL);
return editor;
}
char *
nm_vpn_plugin_utils_get_cert_path(const char *plugin)
{
const char *path;
g_return_val_if_fail(plugin, NULL);
/* Users can set NM_CERT_PATH=~/.cert to be compatible with the certificate
* directory used in the past. */
path = g_getenv("NM_CERT_PATH");
if (path)
return g_build_filename(path, plugin, NULL);
/* Otherwise use XDG_DATA_HOME. We use subdirectory "networkmanagement/certificates"
* because the SELinux policy already has rules to set the correct labels in that
* directory. */
path = g_getenv("XDG_DATA_HOME");
if (path)
return g_build_filename(path, "networkmanagement", "certificates", plugin, NULL);
/* Use the default value for XDG_DATA_HOME */
return g_build_filename(g_get_home_dir(),
".local",
"share",
"networkmanagement",
"certificates",
plugin,
NULL);
}

View file

@ -24,4 +24,6 @@ NMVpnEditor *nm_vpn_plugin_utils_load_editor(const char *modul
gpointer user_data,
GError **error);
char *nm_vpn_plugin_utils_get_cert_path(const char *plugin);
#endif /* __NM_VPN_PLUGIN_UTILS_H__ */

View file

@ -1509,7 +1509,6 @@ nm_utils_ip_route_attribute_to_platform(int addr_family,
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_INITCWND, r->initcwnd, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_INITRWND, r->initrwnd, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_MTU, r->mtu, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_RTO_MIN, r->rto_min, UINT32, uint32, 0);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_QUICKACK, r->quickack, BOOLEAN, boolean, FALSE);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_WINDOW, r->lock_window, BOOLEAN, boolean, FALSE);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_CWND, r->lock_cwnd, BOOLEAN, boolean, FALSE);
@ -1518,6 +1517,18 @@ nm_utils_ip_route_attribute_to_platform(int addr_family,
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_MTU, r->lock_mtu, BOOLEAN, boolean, FALSE);
GET_ATTR(NM_IP_ROUTE_ATTRIBUTE_LOCK_ADVMSS, r->lock_mss, BOOLEAN, boolean, FALSE);
{
GVariant *_variant = nm_ip_route_get_attribute(s_route, NM_IP_ROUTE_ATTRIBUTE_RTO_MIN);
if (_variant && g_variant_is_of_type(_variant, G_VARIANT_TYPE_UINT32)) {
r->rto_min = g_variant_get_uint32(_variant);
r->rto_min_set = TRUE;
} else {
r->rto_min = 0;
r->rto_min_set = FALSE;
}
}
if ((variant = nm_ip_route_get_attribute(s_route, NM_IP_ROUTE_ATTRIBUTE_SRC))
&& g_variant_is_of_type(variant, G_VARIANT_TYPE_STRING)) {
if (inet_pton(addr_family, g_variant_get_string(variant, NULL), &addr) == 1) {

View file

@ -52,8 +52,7 @@
NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE, NM_SETTING_BOND_OPTION_PRIMARY_RESELECT, \
NM_SETTING_BOND_OPTION_RESEND_IGMP, NM_SETTING_BOND_OPTION_USE_CARRIER, \
NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP, \
NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX, \
NM_SETTING_BOND_OPTION_LACP_ACTIVE
NM_SETTING_BOND_OPTION_PEER_NOTIF_DELAY, NM_SETTING_BOND_OPTION_ARP_MISSED_MAX
#define OPTIONS_REAPPLY_FULL \
OPTIONS_REAPPLY_SUBSET, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE, \
@ -137,13 +136,13 @@ _set_bond_attr(NMDevice *device, const char *attr, const char *value)
return ret;
}
#define _set_bond_attr_take(device, attr, value) \
G_STMT_START \
{ \
gs_free char *_tmp = (value); \
\
_set_bond_attr(device, NM_SETTING_BOND_OPTION_ARP_IP_TARGET, _tmp); \
} \
#define _set_bond_attr_take(device, attr, value) \
G_STMT_START \
{ \
gs_free char *_tmp = (value); \
\
_set_bond_attr(device, attr, _tmp); \
} \
G_STMT_END
#define _set_bond_attr_printf(device, attr, fmt, ...) \
@ -902,7 +901,7 @@ reapply_connection(NMDevice *device, NMConnection *con_old, NMConnection *con_ne
mode = _nm_setting_bond_mode_from_string(value);
g_return_if_fail(mode != NM_BOND_MODE_UNKNOWN);
/* Below we set only the bond options that kernel allows to modify
/* Below we set only the bond options that the kernel allows modifying
* while keeping the bond interface up */
set_bond_arp_ip_targets(device, s_bond);

View file

@ -1066,7 +1066,7 @@ attach_port(NMDevice *device,
plat_vlans = setting_vlans_to_platform(vlans, &num_vlans);
/* Since the link was just enportd, there are no existing VLANs
/* Since the link was just attached, there are no existing VLANs
* (except for the default one) and so there's no need to flush. */
if (plat_vlans

View file

@ -14,7 +14,6 @@
#include <libudev.h>
#include <linux/if_ether.h>
#include "NetworkManagerUtils.h"
#include "NetworkManagerUtils.h"
#include "libnm-core-aux-intern/nm-libnm-core-utils.h"
#include "libnm-core-intern/nm-core-internal.h"
@ -708,6 +707,9 @@ supplicant_iface_start(NMDeviceEthernet *self)
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE(self);
gs_unref_object NMSupplicantConfig *config = NULL;
gs_free_error GError *error = NULL;
NMActRequest *request;
NMActiveConnection *controller_ac;
NMDevice *controller;
config = build_supplicant_config(self, &error);
if (!config) {
@ -722,6 +724,16 @@ supplicant_iface_start(NMDeviceEthernet *self)
}
nm_supplicant_interface_disconnect(priv->supplicant.iface);
/* Tell the supplicant in which bridge the interface is */
if ((request = nm_device_get_act_request(NM_DEVICE(self)))
&& (controller_ac = nm_active_connection_get_controller(NM_ACTIVE_CONNECTION(request)))
&& (controller = nm_active_connection_get_device(controller_ac))
&& nm_device_get_device_type(controller) == NM_DEVICE_TYPE_BRIDGE) {
nm_supplicant_interface_set_bridge(priv->supplicant.iface, nm_device_get_iface(controller));
} else
nm_supplicant_interface_set_bridge(priv->supplicant.iface, NULL);
nm_supplicant_interface_assoc(priv->supplicant.iface, config, supplicant_iface_assoc_cb, self);
return TRUE;
}
@ -1901,7 +1913,7 @@ get_ip_method_auto(NMDevice *device, int addr_family)
/* We cannot do DHCPv4 on a PPP link, instead we get "auto" IP addresses
* by pppd. Return "manual" here, which has the suitable effect to a
* (zero) manual addresses in addition. */
return NM_SETTING_IP6_CONFIG_METHOD_MANUAL;
return NM_SETTING_IP4_CONFIG_METHOD_MANUAL;
}
return NM_SETTING_IP6_CONFIG_METHOD_AUTO;

View file

@ -94,8 +94,10 @@ update_properties(NMDevice *device)
CHECK_PROPERTY_CHANGED(multicast_spec, PROP_MULTICAST_SPEC);
CHECK_PROPERTY_CHANGED(prp, PROP_PRP);
if (!nm_ether_addr_equal(&priv->props.supervision_address, &props->supervision_address))
if (!nm_ether_addr_equal(&priv->props.supervision_address, &props->supervision_address)) {
priv->props.supervision_address = props->supervision_address;
_notify(self, PROP_SUPERVISION_ADDRESS);
}
g_object_thaw_notify((GObject *) device);
}
@ -114,29 +116,51 @@ create_and_realize(NMDevice *device,
const NMPlatformLink **out_plink,
GError **error)
{
const char *iface = nm_device_get_iface(device);
NMSettingHsr *s_hsr;
NMPlatformLnkHsr lnk = {};
int r;
const char *iface = nm_device_get_iface(device);
nm_auto_free char *err_msg = NULL;
NMSettingHsr *s_hsr;
NMPlatformLnkHsr lnk = {};
int r = 0;
s_hsr = _nm_connection_get_setting(connection, NM_TYPE_SETTING_HSR);
nm_assert(s_hsr);
if (nm_setting_hsr_get_port1(s_hsr) != NULL)
lnk.port1 = nm_platform_link_get_ifindex(NM_PLATFORM_GET, nm_setting_hsr_get_port1(s_hsr));
if (nm_setting_hsr_get_port2(s_hsr) != NULL)
lnk.port2 = nm_platform_link_get_ifindex(NM_PLATFORM_GET, nm_setting_hsr_get_port2(s_hsr));
lnk.multicast_spec = nm_setting_hsr_get_multicast_spec(s_hsr);
lnk.prp = nm_setting_hsr_get_prp(s_hsr);
if (nm_setting_hsr_get_interlink(s_hsr) != NULL) {
const char *ifname = nm_setting_hsr_get_interlink(s_hsr);
int ifindex = nm_platform_link_get_ifindex(NM_PLATFORM_GET, ifname);
if (ifindex <= 0) {
err_msg = g_strdup_printf("interlink port '%s' does not exist", ifname);
goto out;
}
lnk.interlink = ifindex;
}
lnk.multicast_spec = nm_setting_hsr_get_multicast_spec(s_hsr);
lnk.prp = nm_setting_hsr_get_prp(s_hsr);
lnk.protocol_version = nm_setting_hsr_get_protocol_version(s_hsr);
r = nm_platform_link_hsr_add(nm_device_get_platform(device), iface, &lnk, out_plink);
if (r < 0) {
err_msg = g_strdup(nm_strerror(r) ?: "unknown");
}
out:
if (err_msg) {
g_set_error(error,
NM_DEVICE_ERROR,
NM_DEVICE_ERROR_CREATION_FAILED,
"Failed to create HSR interface '%s' for '%s': %s",
iface,
nm_connection_get_id(connection),
nm_strerror(r));
err_msg);
return FALSE;
}

View file

@ -440,6 +440,9 @@ supplicant_iface_start(NMDeviceMacsec *self)
NMDeviceMacsecPrivate *priv = NM_DEVICE_MACSEC_GET_PRIVATE(self);
gs_unref_object NMSupplicantConfig *config = NULL;
gs_free_error GError *error = NULL;
NMActRequest *request;
NMActiveConnection *controller_ac;
NMDevice *controller;
config = build_supplicant_config(self, &error);
if (!config) {
@ -452,6 +455,16 @@ supplicant_iface_start(NMDeviceMacsec *self)
}
nm_supplicant_interface_disconnect(priv->supplicant.iface);
/* Tell the supplicant in which bridge the interface is */
if ((request = nm_device_get_act_request(NM_DEVICE(self)))
&& (controller_ac = nm_active_connection_get_controller(NM_ACTIVE_CONNECTION(request)))
&& (controller = nm_active_connection_get_device(controller_ac))
&& nm_device_get_device_type(controller) == NM_DEVICE_TYPE_BRIDGE) {
nm_supplicant_interface_set_bridge(priv->supplicant.iface, nm_device_get_iface(controller));
} else
nm_supplicant_interface_set_bridge(priv->supplicant.iface, NULL);
nm_supplicant_interface_assoc(priv->supplicant.iface, config, supplicant_iface_assoc_cb, self);
return TRUE;
}

View file

@ -115,9 +115,6 @@ gboolean nm_device_sysctl_ip_conf_set(NMDevice *self,
NML3ConfigData *nm_device_create_l3_config_data(NMDevice *self, NMIPConfigSource source);
NML3ConfigData *nm_device_create_l3_config_data_from_connection(NMDevice *self,
NMConnection *connection);
void nm_device_ip_method_dhcp4_start(NMDevice *self);
void nm_device_ip_method_autoconf6_start(NMDevice *self);

View file

@ -242,12 +242,14 @@ create_and_realize(NMDevice *device,
g_return_val_if_reached(FALSE);
}
owner = _nm_utils_ascii_str_to_int64(nm_setting_tun_get_owner(s_tun), 10, 0, G_MAXINT32, -1);
owner =
_nm_utils_ascii_str_to_int64(nm_setting_tun_get_owner(s_tun), 10, 0, G_MAXUINT32 - 1, -1);
if (owner != -1) {
props.owner_valid = TRUE;
props.owner = owner;
}
group = _nm_utils_ascii_str_to_int64(nm_setting_tun_get_group(s_tun), 10, 0, G_MAXINT32, -1);
group =
_nm_utils_ascii_str_to_int64(nm_setting_tun_get_group(s_tun), 10, 0, G_MAXUINT32 - 1, -1);
if (group != -1) {
props.group_valid = TRUE;
props.group = group;
@ -278,7 +280,7 @@ _same_og(const char *str, gboolean og_valid, guint32 og_num)
{
gint64 v;
v = _nm_utils_ascii_str_to_int64(str, 10, 0, G_MAXINT32, -1);
v = _nm_utils_ascii_str_to_int64(str, 10, 0, G_MAXUINT32 - 1, -1);
return (!og_valid && (v == (gint64) -1)) || (og_valid && (((guint32) v) == og_num));
}

View file

@ -135,13 +135,17 @@ NM_UTILS_LOOKUP_STR_DEFINE(
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_LINK_NOT_INIT,
"unmanaged-link-not-init"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_QUITTING, "unmanaged-quitting"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_SLEEPING, "unmanaged-sleeping"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_MANAGER_DISABLED,
"unmanaged-nm-disabled"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_USER_CONF, "unmanaged-user-conf"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_USER_EXPLICIT,
"unmanaged-user-explicit"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_USER_SETTINGS,
"unmanaged-user-settings"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_USER_UDEV, "unmanaged-user-udev"), );
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_UNMANAGED_USER_UDEV, "unmanaged-user-udev"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_NETWORKING_OFF, "networking-off"),
NM_UTILS_LOOKUP_STR_ITEM(NM_DEVICE_STATE_REASON_MODEM_NO_OPERATOR_CODE,
"modem-no-operator-code"), );
NM_UTILS_LOOKUP_STR_DEFINE(nm_device_mtu_source_to_string,
NMDeviceMtuSource,

View file

@ -235,7 +235,7 @@ attach_port(NMDevice *device,
_LOGI(LOGD_DEVICE, "attached VRF port %s", port_iface);
} else
_LOGI(LOGD_BOND, "VRF port %s was attached", port_iface);
_LOGI(LOGD_DEVICE, "VRF port %s was attached", port_iface);
return TRUE;
}

View file

@ -1672,6 +1672,57 @@ act_stage2_config(NMDevice *device, NMDeviceStateReason *out_failure_reason)
return ret;
}
static gboolean
skip_peer_route(const NMIPAddr *peer_addr,
guint peer_addr_prefix,
int addr_family,
NMSettingIPConfig *s_ip)
{
guint num_addresses;
guint i;
/*
* If the allowed-ip subnet is already reachable on the interface via the
* prefix route of a static IP address, skip adding the peer route.
* We don't want to override the prefix route with a new one because the
* prefix route also specifies the correct source IP address.
*
* wg-quick does something similar here:
* https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash?h=v1.0.20250521#n177
* The condition in wg-quick is a bit different because it checks that no
* duplicate route exists on the interface. We can't do exactly the same
* because here we don't have visibility on all the platform routes.
*/
if (!s_ip)
return FALSE;
num_addresses = nm_setting_ip_config_get_num_addresses(s_ip);
for (i = 0; i < num_addresses; i++) {
NMIPAddr setting_addr;
NMIPAddr peer_addr_tmp;
guint setting_prefix;
NMIPAddress *a;
peer_addr_tmp = *peer_addr;
a = nm_setting_ip_config_get_address(s_ip, i);
nm_ip_address_get_address_binary(a, &setting_addr);
setting_prefix = nm_ip_address_get_prefix(a);
if (setting_prefix > peer_addr_prefix)
continue;
nm_ip_addr_clear_host_address(addr_family, &setting_addr, NULL, setting_prefix);
nm_ip_addr_clear_host_address(addr_family, &peer_addr_tmp, NULL, setting_prefix);
if (nm_ip_addr_equal(addr_family, &peer_addr_tmp, &setting_addr))
return TRUE;
}
return FALSE;
}
static const NML3ConfigData *
_get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
{
@ -1738,6 +1789,7 @@ _get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
n_aips = nm_wireguard_peer_get_allowed_ips_len(peer);
for (j = 0; j < n_aips; j++) {
NMSettingIPConfig *s_ip;
NMPlatformIPXRoute rt;
NMIPAddr addrbin;
const char *aip;
@ -1745,7 +1797,8 @@ _get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
int prefix;
guint32 rtable_coerced;
aip = nm_wireguard_peer_get_allowed_ip(peer, j, &valid);
aip = nm_wireguard_peer_get_allowed_ip(peer, j, &valid);
s_ip = nm_connection_get_setting_ip_config(connection, addr_family);
if (!valid || !nm_inet_parse_with_prefix_bin(addr_family, aip, NULL, &addrbin, &prefix))
continue;
@ -1754,9 +1807,6 @@ _get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
prefix = (addr_family == AF_INET) ? 32 : 128;
if (prefix == 0) {
NMSettingIPConfig *s_ip;
s_ip = nm_connection_get_setting_ip_config(connection, addr_family);
if (nm_setting_ip_config_get_never_default(s_ip))
continue;
}
@ -1769,6 +1819,9 @@ _get_dev2_ip_config(NMDeviceWireGuard *self, int addr_family)
nm_ip_addr_clear_host_address(addr_family, &addrbin, NULL, prefix);
if (skip_peer_route(&addrbin, prefix, addr_family, s_ip))
continue;
rtable_coerced = route_table_coerced;
if (prefix == 0 && auto_default_route_enabled) {

View file

@ -113,6 +113,19 @@ typedef enum {
RELEASE_PORT_TYPE_CONFIG_FORCE,
} ReleasePortType;
/**
* CleanupType:
* @CLEANUP_TYPE_KEEP: Cleanup internally but keep the real device's config. This is
* often used when moving a partially managed device to "unmanaged" (but not only).
* @CLEANUP_TYPE_REMOVED: The device suddently disappeared. Cleanup internally but don't
* make any action on the real device at all, as it no longer exists.
* @CLEANUP_TYPE_DECONFIGURE: Also deconfigure the real device. This is the typical
* action when a connection or device is set to "down", or fully managed devices
* moved to "unmanaged".
* @CLEANUP_TYPE_KEEP_REAPPLY: Like %CLEANUP_TYPE_KEEP, but indicating that it's a
* reapply. Some special actions can be done if we're doing a reapply, like keeping
* the existing DHCP lease, for example.
*/
typedef enum {
CLEANUP_TYPE_KEEP,
CLEANUP_TYPE_REMOVED,
@ -265,11 +278,11 @@ typedef struct {
NMDeviceIPState state;
union {
struct {
NMDnsMasqManager *dnsmasq_manager;
NMNetnsSharedIPHandle *shared_ip_handle;
NMFirewallConfig *firewall_config;
gulong dnsmasq_state_id;
const NML3ConfigData *l3cd;
NMDnsMasqManager *dnsmasq_manager;
NMNetnsIPReservation *ip_reservation;
NMFirewallConfig *firewall_config;
gulong dnsmasq_state_id;
const NML3ConfigData *l3cd;
} v4;
struct {
} v6;
@ -698,6 +711,8 @@ typedef struct _NMDevicePrivate {
IPDevStateData ipdev_data_unspec;
gulong sharing_ipv4_changed_id;
struct {
/* If we set the addrgenmode6, this records the previously set value. */
guint8 previous_mode_val;
@ -879,6 +894,8 @@ static void _dev_ipshared4_spawn_dnsmasq(NMDevice *self);
static void _dev_ipshared6_start(NMDevice *self);
static void _dev_ipforwarding4_start(NMDevice *self, int addr_family);
static void
_cleanup_ip_pre(NMDevice *self, int addr_family, CleanupType cleanup_type, gboolean preserve_dhcp);
@ -893,6 +910,7 @@ static void device_ifindex_changed_cb(NMManager *manager, NMDevice *device_chang
static gboolean device_link_changed(gpointer user_data);
static gboolean _get_maybe_ipv6_disabled(NMDevice *self);
static void deactivate_ready(NMDevice *self, NMDeviceStateReason reason);
static void carrier_disconnected_action_cancel(NMDevice *self);
/*****************************************************************************/
@ -1406,14 +1424,12 @@ _prop_get_ipvx_routed_dns(NMDevice *self, int addr_family)
}
static NMSettingConnectionMdns
_prop_get_connection_mdns(NMDevice *self)
_prop_get_connection_mdns(NMDevice *self, NMConnection *connection)
{
NMConnection *connection;
NMSettingConnectionMdns mdns = NM_SETTING_CONNECTION_MDNS_DEFAULT;
g_return_val_if_fail(NM_IS_DEVICE(self), NM_SETTING_CONNECTION_MDNS_DEFAULT);
connection = nm_device_get_applied_connection(self);
if (connection)
mdns = nm_setting_connection_get_mdns(nm_connection_get_setting_connection(connection));
if (mdns != NM_SETTING_CONNECTION_MDNS_DEFAULT)
@ -1427,15 +1443,33 @@ _prop_get_connection_mdns(NMDevice *self)
NM_SETTING_CONNECTION_MDNS_DEFAULT);
}
static NMSettingConnectionLlmnr
_prop_get_connection_llmnr(NMDevice *self)
static gboolean
_prop_get_sriov_preserve_on_down(NMDevice *self, NMSettingSriov *s_sriov)
{
NMSriovPreserveOnDown preserve;
g_return_val_if_fail(NM_IS_DEVICE(self), FALSE);
g_return_val_if_fail(NM_IS_SETTING_SRIOV(s_sriov), FALSE);
preserve = nm_setting_sriov_get_preserve_on_down(s_sriov);
if (NM_IN_SET(preserve, NM_SRIOV_PRESERVE_ON_DOWN_NO, NM_SRIOV_PRESERVE_ON_DOWN_YES))
return preserve;
return nm_config_data_get_connection_default_int64(NM_CONFIG_GET_DATA,
NM_CON_DEFAULT("sriov.preserve-on-down"),
self,
NM_SRIOV_PRESERVE_ON_DOWN_NO,
NM_SRIOV_PRESERVE_ON_DOWN_YES,
NM_SRIOV_PRESERVE_ON_DOWN_NO);
}
static NMSettingConnectionLlmnr
_prop_get_connection_llmnr(NMDevice *self, NMConnection *connection)
{
NMConnection *connection;
NMSettingConnectionLlmnr llmnr = NM_SETTING_CONNECTION_LLMNR_DEFAULT;
g_return_val_if_fail(NM_IS_DEVICE(self), NM_SETTING_CONNECTION_LLMNR_DEFAULT);
connection = nm_device_get_applied_connection(self);
if (connection)
llmnr = nm_setting_connection_get_llmnr(nm_connection_get_setting_connection(connection));
if (llmnr != NM_SETTING_CONNECTION_LLMNR_DEFAULT)
@ -1450,14 +1484,12 @@ _prop_get_connection_llmnr(NMDevice *self)
}
static NMSettingConnectionDnsOverTls
_prop_get_connection_dns_over_tls(NMDevice *self)
_prop_get_connection_dns_over_tls(NMDevice *self, NMConnection *connection)
{
NMConnection *connection;
NMSettingConnectionDnsOverTls dns_over_tls = NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT;
g_return_val_if_fail(NM_IS_DEVICE(self), NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT);
connection = nm_device_get_applied_connection(self);
if (connection)
dns_over_tls = nm_setting_connection_get_dns_over_tls(
nm_connection_get_setting_connection(connection));
@ -1472,15 +1504,33 @@ _prop_get_connection_dns_over_tls(NMDevice *self)
NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT);
}
static NMMptcpFlags
_prop_get_connection_mptcp_flags(NMDevice *self)
static NMSettingConnectionDnssec
_prop_get_connection_dnssec(NMDevice *self, NMConnection *connection)
{
NMConnection *connection;
NMMptcpFlags mptcp_flags = NM_MPTCP_FLAGS_NONE;
NMSettingConnectionDnssec dnssec = NM_SETTING_CONNECTION_DNSSEC_DEFAULT;
g_return_val_if_fail(NM_IS_DEVICE(self), NM_SETTING_CONNECTION_DNSSEC_DEFAULT);
if (connection)
dnssec = nm_setting_connection_get_dnssec(nm_connection_get_setting_connection(connection));
if (dnssec != NM_SETTING_CONNECTION_DNSSEC_DEFAULT)
return dnssec;
return nm_config_data_get_connection_default_int64(NM_CONFIG_GET_DATA,
NM_CON_DEFAULT("connection.dnssec"),
self,
NM_SETTING_CONNECTION_DNSSEC_NO,
NM_SETTING_CONNECTION_DNSSEC_YES,
NM_SETTING_CONNECTION_DNSSEC_DEFAULT);
}
static NMMptcpFlags
_prop_get_connection_mptcp_flags(NMDevice *self, NMConnection *connection)
{
NMMptcpFlags mptcp_flags = NM_MPTCP_FLAGS_NONE;
g_return_val_if_fail(NM_IS_DEVICE(self), NM_MPTCP_FLAGS_DISABLED);
connection = nm_device_get_applied_connection(self);
if (connection) {
mptcp_flags =
nm_setting_connection_get_mptcp_flags(nm_connection_get_setting_connection(connection));
@ -2122,6 +2172,33 @@ _prop_get_ipvx_dhcp_send_hostname(NMDevice *self, int addr_family)
return send_hostname_v2;
}
static NMSettingIPConfigForwarding
_prop_get_ipv4_forwarding(NMDevice *self)
{
NMSettingIPConfig *s_ip;
NMSettingIPConfigForwarding forwarding;
g_return_val_if_fail(NM_IS_DEVICE(self), NM_SETTING_IP_CONFIG_FORWARDING_AUTO);
s_ip = nm_device_get_applied_setting(self, NM_TYPE_SETTING_IP4_CONFIG);
if (s_ip)
forwarding = nm_setting_ip_config_get_forwarding(s_ip);
else
forwarding = NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT;
if (forwarding == NM_SETTING_IP_CONFIG_FORWARDING_DEFAULT) {
forwarding =
nm_config_data_get_connection_default_int64(NM_CONFIG_GET_DATA,
NM_CON_DEFAULT("ipv4.forwarding"),
self,
NM_SETTING_IP_CONFIG_FORWARDING_NO,
NM_SETTING_IP_CONFIG_FORWARDING_AUTO,
NM_SETTING_IP_CONFIG_FORWARDING_AUTO);
}
return forwarding;
}
static gboolean
_prop_get_connection_ip_ping_addresses_require_all(NMDevice *self, NMSettingConnection *s_con)
{
@ -2419,16 +2496,14 @@ _prop_get_ipv4_dhcp_vendor_class_identifier(NMDevice *self, NMSettingIP4Config *
}
static NMSettingIP6ConfigPrivacy
_prop_get_ipv6_ip6_privacy(NMDevice *self)
_prop_get_ipv6_ip6_privacy(NMDevice *self, NMConnection *connection)
{
NMSettingIP6ConfigPrivacy ip6_privacy;
NMConnection *connection;
g_return_val_if_fail(self, NM_SETTING_IP6_CONFIG_PRIVACY_UNKNOWN);
/* 1.) First look at the per-connection setting. If it is not -1 (unknown),
* use it. */
connection = nm_device_get_applied_connection(self);
if (connection) {
NMSettingIPConfig *s_ip6 = nm_connection_get_setting_ip6_config(connection);
@ -2730,7 +2805,7 @@ _ethtool_features_set(NMDevice *self,
if (nm_setting_ethtool_init_features(s_ethtool, ethtool_state->requested) == 0)
return;
features = nm_platform_ethtool_get_link_features(platform, ethtool_state->ifindex);
features = nm_platform_ethtool_get_features(platform, ethtool_state->ifindex);
if (!features) {
_LOGW(LOGD_DEVICE, "ethtool: failure setting offload features (cannot read features)");
return;
@ -2849,9 +2924,9 @@ _ethtool_coalesce_set(NMDevice *self,
continue;
if (!has_old) {
if (!nm_platform_ethtool_get_link_coalesce(platform,
ethtool_state->ifindex,
&coalesce_old)) {
if (!nm_platform_ethtool_get_coalesce(platform,
ethtool_state->ifindex,
&coalesce_old)) {
_LOGW(LOGD_DEVICE, "ethtool: failure getting coalesce settings (cannot read)");
return;
}
@ -2930,7 +3005,7 @@ _ethtool_ring_set(NMDevice *self,
nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_UINT32));
if (!has_old) {
if (!nm_platform_ethtool_get_link_ring(platform, ethtool_state->ifindex, &ring_old)) {
if (!nm_platform_ethtool_get_ring(platform, ethtool_state->ifindex, &ring_old)) {
_LOGW(LOGD_DEVICE,
"ethtool: failure setting ring options (cannot read existing setting)");
return;
@ -3026,9 +3101,9 @@ _ethtool_channels_set(NMDevice *self,
nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_UINT32));
if (!has_old) {
if (!nm_platform_ethtool_get_link_channels(platform,
ethtool_state->ifindex,
&channels_old)) {
if (!nm_platform_ethtool_get_channels(platform,
ethtool_state->ifindex,
&channels_old)) {
_LOGW(LOGD_DEVICE,
"ethtool: failure setting channels options (cannot read existing setting)");
return;
@ -3145,7 +3220,7 @@ _ethtool_pause_set(NMDevice *self,
nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_BOOLEAN));
if (!has_old) {
if (!nm_platform_ethtool_get_link_pause(platform, ethtool_state->ifindex, &pause_old)) {
if (!nm_platform_ethtool_get_pause(platform, ethtool_state->ifindex, &pause_old)) {
_LOGW(LOGD_DEVICE,
"ethtool: failure setting pause options (cannot read "
"existing setting)");
@ -3231,7 +3306,7 @@ _ethtool_eee_set(NMDevice *self,
nm_assert(g_variant_is_of_type(variant, G_VARIANT_TYPE_BOOLEAN));
if (!has_old) {
if (!nm_platform_ethtool_get_link_eee(platform, ethtool_state->ifindex, &eee_old)) {
if (!nm_platform_ethtool_get_eee(platform, ethtool_state->ifindex, &eee_old)) {
_LOGW(LOGD_DEVICE,
"ethtool: failure setting eee options (cannot read "
"existing setting)");
@ -3561,11 +3636,12 @@ nm_device_create_l3_config_data_from_connection(NMDevice *self, NMConnection *co
l3cd =
nm_l3_config_data_new_from_connection(nm_device_get_multi_index(self), ifindex, connection);
nm_l3_config_data_set_mdns(l3cd, _prop_get_connection_mdns(self));
nm_l3_config_data_set_llmnr(l3cd, _prop_get_connection_llmnr(self));
nm_l3_config_data_set_dns_over_tls(l3cd, _prop_get_connection_dns_over_tls(self));
nm_l3_config_data_set_ip6_privacy(l3cd, _prop_get_ipv6_ip6_privacy(self));
nm_l3_config_data_set_mptcp_flags(l3cd, _prop_get_connection_mptcp_flags(self));
nm_l3_config_data_set_mdns(l3cd, _prop_get_connection_mdns(self, connection));
nm_l3_config_data_set_llmnr(l3cd, _prop_get_connection_llmnr(self, connection));
nm_l3_config_data_set_dns_over_tls(l3cd, _prop_get_connection_dns_over_tls(self, connection));
nm_l3_config_data_set_dnssec(l3cd, _prop_get_connection_dnssec(self, connection));
nm_l3_config_data_set_ip6_privacy(l3cd, _prop_get_ipv6_ip6_privacy(self, connection));
nm_l3_config_data_set_mptcp_flags(l3cd, _prop_get_connection_mptcp_flags(self, connection));
return l3cd;
}
@ -5006,6 +5082,10 @@ _set_ifindex(NMDevice *self, int ifindex, gboolean is_ip_ifindex)
ip_ifindex_new = nm_device_get_ip_ifindex(self);
/* the ifindex changed; forget about any carrier change event for
* the previous ifindex */
carrier_disconnected_action_cancel(self);
if (priv->l3cfg) {
if (ip_ifindex_new <= 0 || ip_ifindex_new != nm_l3cfg_get_ifindex(priv->l3cfg)) {
const NML3ConfigData *l3cd_old;
@ -6264,6 +6344,14 @@ concheck_is_possible(NMDevice *self)
if (priv->state == NM_DEVICE_STATE_UNKNOWN)
return FALSE;
if (!nm_config_data_get_device_config_boolean_by_device(
NM_CONFIG_GET_DATA,
NM_CONFIG_KEYFILE_KEY_DEVICE_CHECK_CONNECTIVITY,
self,
TRUE,
TRUE))
return FALSE;
return TRUE;
}
@ -6284,8 +6372,10 @@ concheck_periodic_schedule_do(NMDevice *self, int addr_family, gint64 now_ns)
goto out;
}
if (!concheck_is_possible(self))
if (!concheck_is_possible(self)) {
concheck_update_state(self, addr_family, NM_CONNECTIVITY_UNKNOWN, FALSE);
goto out;
}
nm_assert(now_ns > 0);
nm_assert(priv->concheck_x[IS_IPv4].p_cur_interval > 0);
@ -6508,7 +6598,11 @@ concheck_update_interval(NMDevice *self, int addr_family, gboolean check_now)
concheck_periodic_schedule_do(self, addr_family, 0);
/* also update the fake connectivity state. */
concheck_update_state(self, addr_family, NM_CONNECTIVITY_FAKE, TRUE);
if (concheck_is_possible(self))
concheck_update_state(self, addr_family, NM_CONNECTIVITY_FAKE, TRUE);
else
concheck_update_state(self, addr_family, NM_CONNECTIVITY_UNKNOWN, FALSE);
return;
}
@ -6537,6 +6631,7 @@ concheck_update_state(NMDevice *self,
/* @state is a result of the connectivity check. We only expect a precise
* number of possible values. */
nm_assert(NM_IN_SET(state,
NM_CONNECTIVITY_UNKNOWN,
NM_CONNECTIVITY_LIMITED,
NM_CONNECTIVITY_PORTAL,
NM_CONNECTIVITY_FULL,
@ -6597,8 +6692,12 @@ concheck_update_state(NMDevice *self,
_notify(self, IS_IPv4 ? PROP_IP4_CONNECTIVITY : PROP_IP6_CONNECTIVITY);
if (priv->state == NM_DEVICE_STATE_ACTIVATED && !nm_device_managed_type_is_external(self))
/* State change could've affected the route metrics (removed the penalty
* once FULL connectivity is reached), redo the L3 configuration. */
if (priv->state > NM_DEVICE_STATE_IP_CONFIG && priv->state < NM_DEVICE_STATE_DEACTIVATING
&& !nm_device_managed_type_is_external(self)) {
_dev_l3_register_l3cds(self, priv->l3cfg, TRUE, NM_TERNARY_DEFAULT);
}
}
static const char *
@ -6856,8 +6955,11 @@ nm_device_check_connectivity(NMDevice *self,
NMDeviceConnectivityCallback callback,
gpointer user_data)
{
if (!concheck_is_possible(self))
if (!concheck_is_possible(self)) {
concheck_update_state(self, AF_INET, NM_CONNECTIVITY_UNKNOWN, FALSE);
concheck_update_state(self, AF_INET6, NM_CONNECTIVITY_UNKNOWN, FALSE);
return NULL;
}
concheck_periodic_schedule_set(self, addr_family, CONCHECK_SCHEDULE_CHECK_EXTERNAL);
return concheck_start(self, addr_family, callback, user_data, FALSE);
@ -7738,9 +7840,7 @@ device_link_changed(gpointer user_data)
* tagged for carrier ignore) ensure that when the carrier appears we
* renew DHCP leases and such.
*/
if (priv->state == NM_DEVICE_STATE_ACTIVATED) {
nm_device_update_dynamic_ip_setup(self, "interface got carrier");
}
nm_device_update_dynamic_ip_setup(self, "interface got carrier");
}
if (update_unmanaged_specs)
@ -8247,6 +8347,17 @@ config_changed(NMConfig *config,
&& !nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV))
device_init_static_sriov_num_vfs(self);
}
if (NM_FLAGS_HAS(changes, NM_CONFIG_CHANGE_VALUES) && concheck_is_possible(self)) {
/* restart (periodic) connectivity checks if they were previously disabled */
if (!nm_config_data_get_device_config_boolean_by_device(
old_data,
NM_CONFIG_KEYFILE_KEY_DEVICE_CHECK_CONNECTIVITY,
self,
TRUE,
TRUE))
nm_device_check_connectivity_update_interval(self);
}
}
static void
@ -8597,6 +8708,8 @@ nm_device_unrealize(NMDevice *self, gboolean remove_resources, GError **error)
g_object_thaw_notify(G_OBJECT(self));
nm_device_managed_type_set(self, NM_DEVICE_MANAGED_TYPE_REMOVED);
nm_device_set_unmanaged_flags(self, NM_UNMANAGED_PLATFORM_INIT, TRUE);
nm_device_set_unmanaged_flags(self,
@ -8987,7 +9100,7 @@ nm_device_port_notify_attach_as_port(NMDevice *self, gboolean success)
priv->is_attached = TRUE;
_notify(priv->controller, PROP_CONTROLLER);
_notify(self, PROP_CONTROLLER);
nm_clear_pointer(&NM_DEVICE_GET_PRIVATE(priv->controller)->ports_variant,
g_variant_unref);
@ -9066,7 +9179,7 @@ nm_device_port_notify_release(NMDevice *self,
priv->is_attached = FALSE;
_notify(priv->controller, PROP_CONTROLLER);
_notify(self, PROP_CONTROLLER);
nm_clear_pointer(&NM_DEVICE_GET_PRIVATE(priv->controller)->ports_variant, g_variant_unref);
nm_gobject_notify_together(priv->controller, PROP_PORTS, PROP_SLAVES);
@ -9122,6 +9235,10 @@ is_available(NMDevice *self, NMDeviceCheckDevAvailableFlags flags)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
/* unrealized software devices are always available, hardware devices never */
if (!nm_device_is_real(self))
return nm_device_is_software(self);
if (priv->carrier || priv->ignore_carrier)
return TRUE;
@ -9534,7 +9651,7 @@ nm_device_generate_connection(NMDevice *self,
NM_SETTING_CONNECTION_ID,
ifname,
NM_SETTING_CONNECTION_AUTOCONNECT,
FALSE,
TRUE,
NM_SETTING_CONNECTION_INTERFACE_NAME,
ifname,
NM_SETTING_CONNECTION_TIMESTAMP,
@ -11479,6 +11596,13 @@ _dev_ipdhcpx_notify(NMDhcpClient *client, const NMDhcpClientNotifyData *notify_d
switch (notify_data->notify_type) {
case NM_DHCP_CLIENT_NOTIFY_TYPE_PREFIX_DELEGATED:
nm_assert(!IS_IPv4);
if (notify_data->prefix_delegated.prefix->plen == 0
|| notify_data->prefix_delegated.prefix->plen > 64) {
_LOGW_ipdhcp(addr_family,
"ignoring invalid prefix-delegation with length %u",
notify_data->prefix_delegated.prefix->plen);
return;
}
/* Just re-emit. The device just contributes the prefix to the
* pool in NMPolicy, which decides about subnet allocation
* on the shared devices. */
@ -12903,7 +13027,7 @@ _dev_ipac6_start(NMDevice *self)
.router_solicitations = router_solicitations,
.router_solicitation_interval = router_solicitation_interval,
.ra_timeout = ra_timeout,
.ip6_privacy = _prop_get_ipv6_ip6_privacy(self),
.ip6_privacy = _prop_get_ipv6_ip6_privacy(self, connection),
};
priv->ipac6_data.ndisc = nm_lndp_ndisc_new(&config);
@ -13090,7 +13214,6 @@ _dev_addrgenmode6_set(NMDevice *self, guint8 addr_gen_mode)
if (!priv->addrgenmode6_data.previous_mode_has) {
priv->addrgenmode6_data.previous_mode_has = TRUE;
priv->addrgenmode6_data.previous_mode_val = cur_addr_gen_mode;
nm_assert(priv->addrgenmode6_data.previous_mode_val == cur_addr_gen_mode);
}
_LOGD_ip(AF_INET6,
@ -13221,6 +13344,8 @@ activate_stage3_ip_config_for_addr_family(NMDevice *self, int addr_family)
if (priv->ipll_data_4.v4.mode == NM_SETTING_IP4_LL_ENABLED)
_dev_ipll4_start(self);
_dev_ipforwarding4_start(self, addr_family);
if (nm_streq(priv->ipv4_method, NM_SETTING_IP4_CONFIG_METHOD_AUTO))
_dev_ipdhcpx_start(self, AF_INET);
else if (nm_streq(priv->ipv4_method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) {
@ -13513,7 +13638,8 @@ activate_stage3_ip_config(NMDevice *self)
* IPv6LL if this is not an assumed connection, since assumed connections
* will already have IPv6 set up.
*/
if (!nm_device_managed_type_is_external_or_assume(self))
if ((priv->state <= NM_DEVICE_STATE_IP_CONFIG || priv->ip_data_6.do_reapply)
&& !nm_device_managed_type_is_external_or_assume(self))
_dev_addrgenmode6_set(self, NM_IN6_ADDR_GEN_MODE_NONE);
/* Re-enable IPv6 on the interface */
@ -13539,15 +13665,21 @@ nm_device_activate_schedule_stage3_ip_config(NMDevice *self, gboolean do_sync)
static void
_dev_ipsharedx_set_state(NMDevice *self, int addr_family, NMDeviceIPState state)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
const int IS_IPv4 = NM_IS_IPv4(addr_family);
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
const int IS_IPv4 = NM_IS_IPv4(addr_family);
NMDeviceIPState old_state = priv->ipshared_data_x[IS_IPv4].state;
if (priv->ipshared_data_x[IS_IPv4].state != state) {
if (old_state != state) {
_LOGD_ipshared(addr_family,
"set state %s (was %s)",
nm_device_ip_state_to_string(state),
nm_device_ip_state_to_string(priv->ipshared_data_x[IS_IPv4].state));
nm_device_ip_state_to_string(old_state));
priv->ipshared_data_x[IS_IPv4].state = state;
if (old_state == NM_DEVICE_IP_STATE_READY || state == NM_DEVICE_IP_STATE_READY)
nm_manager_update_shared_connection(NM_MANAGER_GET,
addr_family,
state == NM_DEVICE_IP_STATE_READY);
}
}
@ -13570,7 +13702,7 @@ _dev_ipsharedx_cleanup(NMDevice *self, int addr_family)
nm_clear_pointer(&priv->ipshared_data_4.v4.firewall_config, nm_firewall_config_free);
}
nm_clear_pointer(&priv->ipshared_data_4.v4.shared_ip_handle, nm_netns_shared_ip_release);
nm_clear_pointer(&priv->ipshared_data_4.v4.ip_reservation, nm_netns_ip_reservation_release);
nm_clear_l3cd(&priv->ipshared_data_4.v4.l3cd);
_dev_l3_register_l3cds_set_one(self, L3_CONFIG_DATA_TYPE_SHARED_4, NULL, FALSE);
@ -13604,13 +13736,14 @@ _dev_ipshared4_new_l3cd(NMDevice *self, NMConnection *connection, NMPlatformIP4A
nm_ip_address_get_address_binary(user, &a);
nm_platform_ip4_address_set_addr(&address, a, nm_ip_address_get_prefix(user));
nm_clear_pointer(&priv->ipshared_data_4.v4.shared_ip_handle, nm_netns_shared_ip_release);
nm_clear_pointer(&priv->ipshared_data_4.v4.ip_reservation, nm_netns_ip_reservation_release);
} else {
if (!priv->ipshared_data_4.v4.shared_ip_handle)
priv->ipshared_data_4.v4.shared_ip_handle =
nm_netns_shared_ip_reserve(nm_device_get_netns(self));
if (!priv->ipshared_data_4.v4.ip_reservation)
priv->ipshared_data_4.v4.ip_reservation =
nm_netns_ip_reservation_get(nm_device_get_netns(self),
NM_NETNS_IP_RESERVATION_TYPE_SHARED4);
nm_platform_ip4_address_set_addr(&address,
priv->ipshared_data_4.v4.shared_ip_handle->addr,
priv->ipshared_data_4.v4.ip_reservation->addr,
24);
}
@ -13648,19 +13781,6 @@ _dev_ipshared4_init(NMDevice *self)
break;
}
if (nm_platform_sysctl_get_int32(nm_device_get_platform(self),
NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/ip_forward"),
-1)
== 1) {
/* nothing to do. */
} else if (!nm_platform_sysctl_set(nm_device_get_platform(self),
NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/ip_forward"),
"1")) {
errsv = errno;
_LOGW_ipshared(AF_INET, "error enabling IPv4 forwarding: %s", nm_strerror_native(errsv));
return FALSE;
}
if (nm_platform_sysctl_get_int32(nm_device_get_platform(self),
NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/ip_dynaddr"),
-1)
@ -13855,6 +13975,106 @@ _dev_ipshared6_start(NMDevice *self)
/*****************************************************************************/
/**
* Set the device's forwarding to the specified value. If %NM_TERNARY_DEFAULT is specified,
* it's set to the kernel's default, otherwise it's set to the specific value.
*/
static void
_dev_ipforwarding4_set(NMDevice *self, NMTernary val)
{
gs_free const char *default_forwarding = NULL;
gs_free const char *current_forwarding = NULL;
const char *val_str;
if (val != NM_TERNARY_DEFAULT) {
val_str = val ? "1" : "0";
} else {
default_forwarding = nm_platform_sysctl_get(
nm_device_get_platform(self),
NMP_SYSCTL_PATHID_ABSOLUTE("/proc/sys/net/ipv4/conf/default/forwarding"));
if (!default_forwarding) {
_LOGW(LOGD_DEVICE,
"error setting IPv4 forwarding: can't read default forwarding value: %s",
nm_strerror_native(errno));
return; /* Non fatal */
}
val_str = default_forwarding;
}
current_forwarding = nm_device_sysctl_ip_conf_get(self, AF_INET, "forwarding");
if (nm_streq0(current_forwarding, val_str))
return;
if (!nm_device_sysctl_ip_conf_set(self, AF_INET, "forwarding", val_str))
_LOGW(LOGD_DEVICE,
"error setting IPv4 forwarding to '%s': %s",
val_str,
nm_strerror_native(errno));
}
static void
_dev_ipforwarding4_auto_cb(NMManager *manager, gboolean sharing_ipv4, gpointer data)
{
NMDevice *self = NM_DEVICE(data);
_dev_ipforwarding4_set(self, sharing_ipv4 ? NM_TERNARY_TRUE : NM_TERNARY_DEFAULT);
}
static void
_dev_ipforwarding4_start(NMDevice *self, int addr_family)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
NMSettingIPConfigForwarding ipv4_forwarding = _prop_get_ipv4_forwarding(self);
NMTernary new_forwarding = NM_TERNARY_DEFAULT;
/* IPv6 per-interface forwarding not supported yet */
if (addr_family != AF_INET)
return;
if (nm_streq(priv->ipv4_method, NM_SETTING_IP4_CONFIG_METHOD_SHARED)) {
new_forwarding = NM_TERNARY_TRUE;
} else if (ipv4_forwarding == NM_SETTING_IP_CONFIG_FORWARDING_YES) {
new_forwarding = NM_TERNARY_TRUE;
} else if (ipv4_forwarding == NM_SETTING_IP_CONFIG_FORWARDING_NO) {
new_forwarding = NM_TERNARY_FALSE;
} else if (ipv4_forwarding == NM_SETTING_IP_CONFIG_FORWARDING_AUTO) {
if (nm_manager_get_sharing_ipv4(NM_MANAGER_GET))
new_forwarding = NM_TERNARY_TRUE;
else
new_forwarding = NM_TERNARY_DEFAULT;
if (!priv->sharing_ipv4_changed_id)
priv->sharing_ipv4_changed_id = g_signal_connect(NM_MANAGER_GET,
NM_MANAGER_SHARING_IPV4_CHANGED,
G_CALLBACK(_dev_ipforwarding4_auto_cb),
self);
} else {
nm_assert_not_reached();
}
_dev_ipforwarding4_set(self, new_forwarding);
}
static void
_dev_ipforwarding_cleanup(NMDevice *self, int addr_family, CleanupType cleanup_type)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
if (!NM_IS_IPv4(addr_family))
return;
nm_clear_g_signal_handler(NM_MANAGER_GET, &priv->sharing_ipv4_changed_id);
if (NM_IN_SET(cleanup_type, CLEANUP_TYPE_DECONFIGURE, CLEANUP_TYPE_KEEP_REAPPLY)) {
/* Deconfigure by restoring kernel's default */
_dev_ipforwarding4_set(self, NM_TERNARY_DEFAULT);
}
}
/*****************************************************************************/
static void
act_request_set(NMDevice *self, NMActRequest *act_request)
{
@ -13967,6 +14187,8 @@ _cleanup_ip_pre(NMDevice *self, int addr_family, CleanupType cleanup_type, gbool
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE(self);
gboolean keep_reapply = (cleanup_type == CLEANUP_TYPE_KEEP_REAPPLY);
_dev_ipforwarding_cleanup(self, addr_family, cleanup_type);
_dev_ipsharedx_cleanup(self, addr_family);
_dev_ipdev_cleanup(self, AF_UNSPEC);
@ -14114,6 +14336,7 @@ can_reapply_change(NMDevice *self,
NM_SETTING_CONNECTION_MDNS,
NM_SETTING_CONNECTION_LLMNR,
NM_SETTING_CONNECTION_DNS_OVER_TLS,
NM_SETTING_CONNECTION_DNSSEC,
NM_SETTING_CONNECTION_MPTCP_FLAGS,
NM_SETTING_CONNECTION_WAIT_ACTIVATION_DELAY);
}
@ -14138,15 +14361,6 @@ can_reapply_change(NMDevice *self,
goto out_fail;
}
if (NM_IN_STRSET(setting_name,
NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME,
NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME)
&& NM_DEVICE_GET_CLASS(self)->can_reapply_change_ovs_external_ids) {
/* TODO: this means, you cannot reapply changes to the external-ids for
* OVS system interfaces. */
return TRUE;
}
if (nm_streq(setting_name, NM_SETTING_BRIDGE_PORT_SETTING_NAME)) {
return nm_device_hash_check_invalid_keys(diffs,
NM_SETTING_BRIDGE_PORT_SETTING_NAME,
@ -14158,6 +14372,7 @@ can_reapply_change(NMDevice *self,
return nm_device_hash_check_invalid_keys(diffs,
NM_SETTING_SRIOV_SETTING_NAME,
error,
NM_SETTING_SRIOV_PRESERVE_ON_DOWN,
NM_SETTING_SRIOV_VFS);
}
@ -14380,6 +14595,7 @@ check_and_reapply_connection(NMDevice *self,
NM_SETTING_CONNECTION_MDNS,
NM_SETTING_CONNECTION_LLMNR,
NM_SETTING_CONNECTION_DNS_OVER_TLS,
NM_SETTING_CONNECTION_DNSSEC,
NM_SETTING_CONNECTION_MPTCP_FLAGS)) {
priv->ip_data_4.do_reapply = TRUE;
priv->ip_data_6.do_reapply = TRUE;
@ -15731,7 +15947,7 @@ nm_device_get_firmware_missing(NMDevice *self)
NM_UTILS_FLAGS2STR_DEFINE(nm_unmanaged_flags2str,
NMUnmanagedFlags,
NM_UTILS_FLAGS2STR(NM_UNMANAGED_SLEEPING, "sleeping"),
NM_UTILS_FLAGS2STR(NM_UNMANAGED_MANAGER_DISABLED, "nm-disabled"),
NM_UTILS_FLAGS2STR(NM_UNMANAGED_QUITTING, "quitting"),
NM_UTILS_FLAGS2STR(NM_UNMANAGED_PLATFORM_INIT, "platform-init"),
NM_UTILS_FLAGS2STR(NM_UNMANAGED_USER_EXPLICIT, "user-explicit"),
@ -15795,8 +16011,8 @@ unmanaged_flags_to_reason(NMUnmanagedFlags flags)
/* Even if there are multiple flags, we can only return one reason.
* Return the most important reason.
*/
if (NM_FLAGS_HAS(flags, NM_UNMANAGED_SLEEPING))
return NM_DEVICE_STATE_REASON_UNMANAGED_SLEEPING;
if (NM_FLAGS_HAS(flags, NM_UNMANAGED_MANAGER_DISABLED))
return NM_DEVICE_STATE_REASON_UNMANAGED_MANAGER_DISABLED;
if (NM_FLAGS_HAS(flags, NM_UNMANAGED_QUITTING))
return NM_DEVICE_STATE_REASON_UNMANAGED_QUITTING;
if (NM_FLAGS_HAS(flags, NM_UNMANAGED_USER_SETTINGS))
@ -17124,6 +17340,25 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu
/* controller: release ports */
nm_device_controller_release_ports_all(self);
/* port: detach from controller */
if (priv->controller) {
nm_device_controller_release_port(priv->controller,
self,
RELEASE_PORT_TYPE_CONFIG,
reason);
}
}
/* port: mark no longer attached */
if (priv->controller && priv->ifindex > 0
&& nm_platform_link_get_controller(nm_device_get_platform(self), priv->ifindex) <= 0) {
nm_device_controller_release_port(priv->controller,
self,
RELEASE_PORT_TYPE_NO_CONFIG,
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
}
if (cleanup_type == CLEANUP_TYPE_DECONFIGURE) {
/* Take out any entries in the routing table and any IP address the device had. */
if (ifindex > 0) {
NMPlatform *platform = nm_device_get_platform(self);
@ -17147,15 +17382,6 @@ nm_device_cleanup(NMDevice *self, NMDeviceStateReason reason, CleanupType cleanu
if (ifindex > 0)
nm_platform_ip4_dev_route_blacklist_set(nm_device_get_platform(self), ifindex, NULL);
/* port: mark no longer attached */
if (priv->controller && priv->ifindex > 0
&& nm_platform_link_get_controller(nm_device_get_platform(self), priv->ifindex) <= 0) {
nm_device_controller_release_port(priv->controller,
self,
RELEASE_PORT_TYPE_NO_CONFIG,
NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
}
lldp_setup(self, NM_TERNARY_FALSE);
nm_device_update_metered(self);
@ -17633,7 +17859,8 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
}
if (priv->ifindex > 0
&& (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV))) {
&& (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV))
&& (!_prop_get_sriov_preserve_on_down(self, s_sriov))) {
priv->sriov_reset_pending++;
sriov_op_queue(self,
0,
@ -17689,7 +17916,8 @@ _set_state_full(NMDevice *self, NMDeviceState state, NMDeviceStateReason reason,
nm_settings_connection_update_timestamp(sett_conn, (guint64) 0);
if (priv->ifindex > 0
&& (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV))) {
&& (s_sriov = nm_device_get_applied_setting(self, NM_TYPE_SETTING_SRIOV))
&& (!_prop_get_sriov_preserve_on_down(self, s_sriov))) {
priv->sriov_reset_pending++;
sriov_op_queue(self,
0,
@ -18810,7 +19038,7 @@ hostname_dns_lookup_callback(GObject *source, GAsyncResult *result, gpointer use
gboolean valid;
resolver->hostname = g_steal_pointer(&output);
valid = nm_utils_validate_hostname(resolver->hostname);
valid = nm_sd_dns_name_is_valid(resolver->hostname);
_LOGD(LOGD_DNS,
"hostname-from-dns: ipv%c resolver %s: lookup successful for %s, result %s%s%s%s",

View file

@ -209,8 +209,6 @@ typedef struct _NMDeviceClass {
bool act_stage1_prepare_set_hwaddr_ethernet : 1;
bool can_reapply_change_ovs_external_ids : 1;
bool allow_autoconnect_on_external : 1;
NMRfkillType rfkill_type : 4;
@ -583,7 +581,8 @@ void nm_device_copy_ip6_dns_config(NMDevice *self, NMDevice *from_device);
/**
* NMUnmanagedFlags:
* @NM_UNMANAGED_NONE: placeholder value
* @NM_UNMANAGED_SLEEPING: %TRUE when unmanaged because NM is sleeping.
* @NM_UNMANAGED_MANAGER_DISABLED: %TRUE when unmanaged because NM is disabled.
* Currently, this happens when sleeping or with networking disabled.
* @NM_UNMANAGED_QUITTING: %TRUE when unmanaged because NM is shutting down.
* @NM_UNMANAGED_PLATFORM_INIT: %TRUE when unmanaged because platform link not
* yet initialized. Unrealized device are also unmanaged for this reason.
@ -612,11 +611,11 @@ typedef enum {
/* these flags are authoritative. If one of them is set,
* the device cannot be managed. */
NM_UNMANAGED_SLEEPING = (1LL << 0),
NM_UNMANAGED_QUITTING = (1LL << 1),
NM_UNMANAGED_PLATFORM_INIT = (1LL << 2),
NM_UNMANAGED_USER_EXPLICIT = (1LL << 3),
NM_UNMANAGED_USER_SETTINGS = (1LL << 4),
NM_UNMANAGED_MANAGER_DISABLED = (1LL << 0),
NM_UNMANAGED_QUITTING = (1LL << 1),
NM_UNMANAGED_PLATFORM_INIT = (1LL << 2),
NM_UNMANAGED_USER_EXPLICIT = (1LL << 3),
NM_UNMANAGED_USER_SETTINGS = (1LL << 4),
/* These flags can be non-effective and be overwritten
* by other flags. */
@ -854,4 +853,7 @@ void nm_routing_rules_sync(NMConnection *applied_connection,
NMDevice *self,
NMNetns *netns);
NML3ConfigData *nm_device_create_l3_config_data_from_connection(NMDevice *self,
NMConnection *connection);
#endif /* __NETWORKMANAGER_DEVICE_H__ */

View file

@ -310,7 +310,7 @@ format_string(const guint8 *data, gsize len, gboolean allow_trim, char **out_to_
if (len == 0)
return NULL;
if (memchr(data, len, '\0'))
if (memchr(data, '\0', len))
return NULL;
return nm_utils_buf_utf8safe_escape(data,

View file

@ -162,6 +162,11 @@ can_reapply_change(NMDevice *device,
NM_SETTING_OVS_BRIDGE_STP_ENABLE);
}
if (NM_IN_STRSET(setting_name,
NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME,
NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME))
return TRUE;
return device_class->can_reapply_change(device, setting_name, s_old, s_new, diffs, error);
}
@ -194,16 +199,15 @@ nm_device_ovs_bridge_class_init(NMDeviceOvsBridgeClass *klass)
device_class->connection_type_check_compatible = NM_SETTING_OVS_BRIDGE_SETTING_NAME;
device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES();
device_class->is_controller = TRUE;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->unrealize = unrealize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->act_stage3_ip_config = act_stage3_ip_config;
device_class->ready_for_ip_config = ready_for_ip_config;
device_class->attach_port = attach_port;
device_class->detach_port = detach_port;
device_class->can_reapply_change = can_reapply_change;
device_class->can_reapply_change_ovs_external_ids = TRUE;
device_class->reapply_connection = nm_device_ovs_reapply_connection;
device_class->is_controller = TRUE;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->unrealize = unrealize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->act_stage3_ip_config = act_stage3_ip_config;
device_class->ready_for_ip_config = ready_for_ip_config;
device_class->attach_port = attach_port;
device_class->detach_port = detach_port;
device_class->can_reapply_change = can_reapply_change;
device_class->reapply_connection = nm_device_ovs_reapply_connection;
}

View file

@ -16,6 +16,8 @@
#include "nm-setting-ovs-bridge.h"
#include "nm-setting-ovs-interface.h"
#include "nm-setting-ovs-port.h"
#include "nm-setting-ovs-external-ids.h"
#include "nm-setting-ovs-other-config.h"
#define _NMLOG_DEVICE_TYPE NMDeviceOvsInterface
#include "devices/nm-device-logging.h"
@ -631,6 +633,28 @@ can_update_from_platform_link(NMDevice *device, const NMPlatformLink *plink)
return !plink || nm_device_get_state(device) != NM_DEVICE_STATE_DEACTIVATING;
}
static gboolean
can_reapply_change(NMDevice *device,
const char *setting_name,
NMSetting *s_old,
NMSetting *s_new,
GHashTable *diffs,
GError **error)
{
NMDeviceClass *device_class = NM_DEVICE_CLASS(nm_device_ovs_interface_parent_class);
if (NM_IN_STRSET(setting_name,
NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME,
NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME)) {
/* TODO: it's currently not possible to reapply those settings on OVS
* system interfaces because they have type != "ovs-interface" (e.g.
* "ethernet") */
return TRUE;
}
return device_class->can_reapply_change(device, setting_name, s_old, s_new, diffs, error);
}
/*****************************************************************************/
static void
@ -696,21 +720,21 @@ nm_device_ovs_interface_class_init(NMDeviceOvsInterfaceClass *klass)
device_class->connection_type_check_compatible = NM_SETTING_OVS_INTERFACE_SETTING_NAME;
device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES(NM_LINK_TYPE_OPENVSWITCH);
device_class->can_auto_connect = can_auto_connect;
device_class->can_update_from_platform_link = can_update_from_platform_link;
device_class->deactivate = deactivate;
device_class->deactivate_async = deactivate_async;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->is_available = is_available;
device_class->check_connection_compatible = check_connection_compatible;
device_class->link_changed = link_changed;
device_class->act_stage3_ip_config = act_stage3_ip_config;
device_class->ready_for_ip_config = ready_for_ip_config;
device_class->can_unmanaged_external_down = can_unmanaged_external_down;
device_class->set_platform_mtu = set_platform_mtu;
device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
device_class->can_reapply_change_ovs_external_ids = TRUE;
device_class->reapply_connection = nm_device_ovs_reapply_connection;
device_class->can_auto_connect = can_auto_connect;
device_class->can_update_from_platform_link = can_update_from_platform_link;
device_class->deactivate = deactivate;
device_class->deactivate_async = deactivate_async;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->is_available = is_available;
device_class->check_connection_compatible = check_connection_compatible;
device_class->link_changed = link_changed;
device_class->act_stage3_ip_config = act_stage3_ip_config;
device_class->ready_for_ip_config = ready_for_ip_config;
device_class->can_unmanaged_external_down = can_unmanaged_external_down;
device_class->set_platform_mtu = set_platform_mtu;
device_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
device_class->can_reapply_change = can_reapply_change;
device_class->reapply_connection = nm_device_ovs_reapply_connection;
}

View file

@ -16,6 +16,8 @@
#include "nm-setting-connection.h"
#include "nm-setting-ovs-port.h"
#include "nm-setting-ovs-interface.h"
#include "nm-setting-ovs-external-ids.h"
#include "nm-setting-ovs-other-config.h"
#include "nm-setting-wired.h"
#define _NMLOG_DEVICE_TYPE NMDeviceOvsPort
@ -279,6 +281,11 @@ can_reapply_change(NMDevice *device,
NM_SETTING_OVS_PORT_TRUNKS);
}
if (NM_IN_STRSET(setting_name,
NM_SETTING_OVS_EXTERNAL_IDS_SETTING_NAME,
NM_SETTING_OVS_OTHER_CONFIG_SETTING_NAME))
return TRUE;
return device_class->can_reapply_change(device, setting_name, s_old, s_new, diffs, error);
}
@ -311,15 +318,14 @@ nm_device_ovs_port_class_init(NMDeviceOvsPortClass *klass)
device_class->connection_type_check_compatible = NM_SETTING_OVS_PORT_SETTING_NAME;
device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES();
device_class->is_controller = TRUE;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->act_stage3_ip_config = act_stage3_ip_config;
device_class->ready_for_ip_config = ready_for_ip_config;
device_class->attach_port = attach_port;
device_class->detach_port = detach_port;
device_class->can_reapply_change = can_reapply_change;
device_class->can_reapply_change_ovs_external_ids = TRUE;
device_class->reapply_connection = nm_device_ovs_reapply_connection;
device_class->is_controller = TRUE;
device_class->get_type_description = get_type_description;
device_class->create_and_realize = create_and_realize;
device_class->get_generic_capabilities = get_generic_capabilities;
device_class->act_stage3_ip_config = act_stage3_ip_config;
device_class->ready_for_ip_config = ready_for_ip_config;
device_class->attach_port = attach_port;
device_class->detach_port = detach_port;
device_class->can_reapply_change = can_reapply_change;
device_class->reapply_connection = nm_device_ovs_reapply_connection;
}

View file

@ -75,9 +75,6 @@ new_device_from_type(const char *name, NMDeviceType device_type)
const char *type_desc;
NMLinkType link_type = NM_LINK_TYPE_NONE;
if (nm_manager_get_device(NM_MANAGER_GET, name, device_type))
return NULL;
if (device_type == NM_DEVICE_TYPE_OVS_INTERFACE) {
type = NM_TYPE_DEVICE_OVS_INTERFACE;
type_desc = "Open vSwitch Interface";
@ -89,6 +86,7 @@ new_device_from_type(const char *name, NMDeviceType device_type)
type = NM_TYPE_DEVICE_OVS_BRIDGE;
type_desc = "Open vSwitch Bridge";
} else {
_LOGT(name, NULL, "Unrecognized link type: %d", device_type);
return NULL;
}
@ -125,6 +123,11 @@ ovsdb_device_added(NMOvsdb *ovsdb,
return;
}
if (nm_manager_get_device(NM_MANAGER_GET, name, device_type)) {
_LOGT(name, NULL, "Device already registered with manager, skipping.");
return;
}
device = new_device_from_type(name, device_type);
if (!device)
return;
@ -288,23 +291,31 @@ create_device(NMDeviceFactory *self,
{
NMDeviceType device_type = NM_DEVICE_TYPE_UNKNOWN;
const char *connection_type = NULL;
const char *connection_uuid = NULL;
if (g_strcmp0(iface, "ovs-system") == 0) {
*out_ignore = TRUE;
return NULL;
}
if (connection)
if (connection) {
connection_type = nm_connection_get_connection_type(connection);
connection_uuid = nm_connection_get_uuid(connection);
}
if (plink)
if (plink) {
_LOGD(iface, connection_uuid, "creating OVS interface (from a platform link)");
device_type = NM_DEVICE_TYPE_OVS_INTERFACE;
else if (g_strcmp0(connection_type, NM_SETTING_OVS_INTERFACE_SETTING_NAME) == 0)
} else if (nm_streq0(connection_type, NM_SETTING_OVS_INTERFACE_SETTING_NAME)) {
_LOGD(iface, connection_uuid, "creating OVS interface (from setting)");
device_type = NM_DEVICE_TYPE_OVS_INTERFACE;
else if (g_strcmp0(connection_type, NM_SETTING_OVS_PORT_SETTING_NAME) == 0)
} else if (nm_streq0(connection_type, NM_SETTING_OVS_PORT_SETTING_NAME)) {
_LOGD(iface, connection_uuid, "creating OVS port (from setting)");
device_type = NM_DEVICE_TYPE_OVS_PORT;
else if (g_strcmp0(connection_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME) == 0)
} else if (nm_streq0(connection_type, NM_SETTING_OVS_BRIDGE_SETTING_NAME)) {
_LOGD(iface, connection_uuid, "creating OVS bridge (from setting)");
device_type = NM_DEVICE_TYPE_OVS_BRIDGE;
}
return new_device_from_type(iface, device_type);
}

View file

@ -900,15 +900,17 @@ _insert_interface(json_t *params,
s_ovs_patch = nm_connection_get_setting_ovs_patch(interface);
if (s_ovs_dpdk) {
const char *devargs;
guint32 n_rxq;
guint32 n_rxq_desc;
guint32 n_txq_desc;
const char *devargs;
guint32 n_rxq;
guint32 n_rxq_desc;
guint32 n_txq_desc;
NMSettingOvsDpdkLscInterrupt lsc_int;
devargs = nm_setting_ovs_dpdk_get_devargs(s_ovs_dpdk);
n_rxq = nm_setting_ovs_dpdk_get_n_rxq(s_ovs_dpdk);
n_rxq_desc = nm_setting_ovs_dpdk_get_n_rxq_desc(s_ovs_dpdk);
n_txq_desc = nm_setting_ovs_dpdk_get_n_txq_desc(s_ovs_dpdk);
lsc_int = nm_setting_ovs_dpdk_get_lsc_interrupt(s_ovs_dpdk);
dpdk_array = json_array();
@ -930,6 +932,17 @@ _insert_interface(json_t *params,
json_pack("[s,s]", "n_txq_desc", nm_sprintf_buf(sbuf, "%u", n_txq_desc)));
}
switch (lsc_int) {
case NM_SETTING_OVS_DPDK_LSC_INTERRUPT_IGNORE:
break;
case NM_SETTING_OVS_DPDK_LSC_INTERRUPT_ENABLED:
json_array_append_new(dpdk_array, json_pack("[s,s]", "dpdk-lsc-interrupt", "true"));
break;
case NM_SETTING_OVS_DPDK_LSC_INTERRUPT_DISABLED:
json_array_append_new(dpdk_array, json_pack("[s,s]", "dpdk-lsc-interrupt", "false"));
break;
}
json_array_append_new(options, dpdk_array);
} else if (s_ovs_patch) {
@ -1877,7 +1890,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
== -1) {
/* This doesn't really have to be an error; the key might
* be missing if there really are no bridges present. */
_LOGD("Bad update: %s", json_error.text);
_LOGD("monitor: bad update: %s", json_error.text);
}
if (ovs) {
@ -1923,12 +1936,12 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
&unused))
continue;
_LOGT("obj[iface:%s]: removed an '%s' interface: %s%s%s",
key,
ovs_interface->type,
_LOGT("monitor: %s: interface removed: type=%s, obj[iface:%s]%s%s",
ovs_interface->name,
ovs_interface->type,
key,
NM_PRINT_FMT_QUOTED2(ovs_interface->connection_uuid,
", ",
", connection=",
ovs_interface->connection_uuid,
""));
_signal_emit_device_removed(self,
@ -1976,17 +1989,18 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
gs_free char *strtmp1 = NULL;
gs_free char *strtmp2 = NULL;
_LOGT("obj[iface:%s]: changed an '%s' interface: %s%s%s, external-ids=%s, "
"other-config=%s",
key,
type,
ovs_interface->name,
NM_PRINT_FMT_QUOTED2(ovs_interface->connection_uuid,
", ",
ovs_interface->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_interface->external_ids)),
(strtmp2 = _strdict_to_string(ovs_interface->other_config)));
_LOGT(
"monitor: %s: interface changed: type=%s, obj[iface:%s]%s%s, external-ids=%s, "
"other-config=%s",
ovs_interface->name,
type,
key,
NM_PRINT_FMT_QUOTED2(ovs_interface->connection_uuid,
", connection=",
ovs_interface->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_interface->external_ids)),
(strtmp2 = _strdict_to_string(ovs_interface->other_config)));
}
} else {
gs_free char *strtmp1 = NULL;
@ -2002,17 +2016,17 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
.other_config = g_steal_pointer(&other_config_arr),
};
g_hash_table_add(priv->interfaces, ovs_interface);
_LOGT(
"obj[iface:%s]: added an '%s' interface: %s%s%s, external-ids=%s, other-config=%s",
key,
ovs_interface->type,
ovs_interface->name,
NM_PRINT_FMT_QUOTED2(ovs_interface->connection_uuid,
", ",
ovs_interface->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_interface->external_ids)),
(strtmp2 = _strdict_to_string(ovs_interface->other_config)));
_LOGT("monitor: %s: interface added: type=%s, obj[iface:%s]%s%s, external-ids=%s, "
"other-config=%s",
ovs_interface->name,
ovs_interface->type,
key,
NM_PRINT_FMT_QUOTED2(ovs_interface->connection_uuid,
", connection=",
ovs_interface->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_interface->external_ids)),
(strtmp2 = _strdict_to_string(ovs_interface->other_config)));
_signal_emit_device_added(self,
ovs_interface->name,
NM_DEVICE_TYPE_OVS_INTERFACE,
@ -2058,11 +2072,11 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
if (!g_hash_table_steal_extended(priv->ports, &key, (gpointer *) &ovs_port, &unused))
continue;
_LOGT("obj[port:%s]: removed a port: %s%s%s",
key,
_LOGT("monitor: %s: port removed: obj[port:%s]%s%s",
ovs_port->name,
key,
NM_PRINT_FMT_QUOTED2(ovs_port->connection_uuid,
", ",
", connection=",
ovs_port->connection_uuid,
""));
_signal_emit_device_removed(self, ovs_port->name, NM_DEVICE_TYPE_OVS_PORT, NULL);
@ -2109,15 +2123,16 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
gs_free char *strtmp1 = NULL;
gs_free char *strtmp2 = NULL;
_LOGT("obj[port:%s]: changed a port: %s%s%s, external-ids=%s, other-config=%s",
key,
ovs_port->name,
NM_PRINT_FMT_QUOTED2(ovs_port->connection_uuid,
", ",
ovs_port->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_port->external_ids)),
(strtmp2 = _strdict_to_string(ovs_port->other_config)));
_LOGT(
"monitor: %s: port changed: obj[port:%s]%s%s, external-ids=%s, other-config=%s",
ovs_port->name,
key,
NM_PRINT_FMT_QUOTED2(ovs_port->connection_uuid,
", connection=",
ovs_port->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_port->external_ids)),
(strtmp2 = _strdict_to_string(ovs_port->other_config)));
}
} else {
gs_free char *strtmp1 = NULL;
@ -2133,11 +2148,11 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
.other_config = g_steal_pointer(&other_config_arr),
};
g_hash_table_add(priv->ports, ovs_port);
_LOGT("obj[port:%s]: added a port: %s%s%s, external-ids=%s, other-config=%s",
key,
_LOGT("monitor: %s: port added: obj[port:%s]%s%s, external-ids=%s, other-config=%s",
ovs_port->name,
key,
NM_PRINT_FMT_QUOTED2(ovs_port->connection_uuid,
", ",
", connection=",
ovs_port->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_port->external_ids)),
@ -2179,11 +2194,11 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
&unused))
continue;
_LOGT("obj[bridge:%s]: removed a bridge: %s%s%s",
key,
_LOGT("monitor: %s: bridge removed: obj[bridge:%s]%s%s",
ovs_bridge->name,
key,
NM_PRINT_FMT_QUOTED2(ovs_bridge->connection_uuid,
", ",
", connection=",
ovs_bridge->connection_uuid,
""));
_signal_emit_device_removed(self, ovs_bridge->name, NM_DEVICE_TYPE_OVS_BRIDGE, NULL);
@ -2230,15 +2245,16 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
gs_free char *strtmp1 = NULL;
gs_free char *strtmp2 = NULL;
_LOGT("obj[bridge:%s]: changed a bridge: %s%s%s, external-ids=%s, other-config=%s",
key,
_LOGT("monitor: %s: bridge changed: obj[bridge:%s]%s%s, external-ids=%s, "
"other-config=%s",
ovs_bridge->name,
key,
NM_PRINT_FMT_QUOTED2(ovs_bridge->connection_uuid,
", ",
", connection=",
ovs_bridge->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_bridge->external_ids)),
(strtmp2 = _strdict_to_string(ovs_bridge->external_ids)));
(strtmp2 = _strdict_to_string(ovs_bridge->other_config)));
}
} else {
gs_free char *strtmp1 = NULL;
@ -2254,11 +2270,11 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg)
.other_config = g_steal_pointer(&other_config_arr),
};
g_hash_table_add(priv->bridges, ovs_bridge);
_LOGT("obj[bridge:%s]: added a bridge: %s%s%s, external-ids=%s, other-config=%s",
key,
_LOGT("monitor: %s: bridge added: obj[bridge:%s]%s%s, external-ids=%s, other-config=%s",
ovs_bridge->name,
key,
NM_PRINT_FMT_QUOTED2(ovs_bridge->connection_uuid,
", ",
", connection=",
ovs_bridge->connection_uuid,
""),
(strtmp1 = _strdict_to_string(ovs_bridge->external_ids)),

View file

@ -191,12 +191,19 @@ static void supplicant_iface_notify_p2p_available(NMSupplicantInterface *iface,
GParamSpec *pspec,
NMDeviceWifi *self);
static void supplicant_iface_notify_wpa_psk_mismatch_cb(NMSupplicantInterface *iface,
NMDeviceWifi *self);
static void supplicant_iface_notify_wpa_sae_mismatch_cb(NMSupplicantInterface *iface,
NMDeviceWifi *self);
static void periodic_update(NMDeviceWifi *self);
static void ap_add_remove(NMDeviceWifi *self,
gboolean is_adding,
NMWifiAP *ap,
gboolean recheck_available_connections);
gboolean recheck_available_connections,
gboolean recheck_auto_activate);
static void _hw_addr_set_scanning(NMDeviceWifi *self, gboolean do_reset);
@ -623,6 +630,14 @@ supplicant_interface_acquire_cb(NMSupplicantManager *supplicant_manager,
"notify::" NM_SUPPLICANT_INTERFACE_P2P_AVAILABLE,
G_CALLBACK(supplicant_iface_notify_p2p_available),
self);
g_signal_connect(priv->sup_iface,
NM_SUPPLICANT_INTERFACE_PSK_MISMATCH,
G_CALLBACK(supplicant_iface_notify_wpa_psk_mismatch_cb),
self);
g_signal_connect(priv->sup_iface,
NM_SUPPLICANT_INTERFACE_SAE_MISMATCH,
G_CALLBACK(supplicant_iface_notify_wpa_sae_mismatch_cb),
self);
_scan_notify_is_scanning(self);
@ -714,7 +729,10 @@ update_seen_bssids_cache(NMDeviceWifi *self, NMWifiAP *ap)
}
static void
set_current_ap(NMDeviceWifi *self, NMWifiAP *new_ap, gboolean recheck_available_connections)
set_current_ap(NMDeviceWifi *self,
NMWifiAP *new_ap,
gboolean recheck_available_connections,
gboolean recheck_auto_activate)
{
NMDeviceWifiPrivate *priv;
NMWifiAP *old_ap;
@ -741,7 +759,11 @@ set_current_ap(NMDeviceWifi *self, NMWifiAP *new_ap, gboolean recheck_available_
/* Remove any AP from the internal list if it was created by NM or isn't known to the supplicant */
if (NM_IN_SET(mode, _NM_802_11_MODE_ADHOC, _NM_802_11_MODE_AP)
|| nm_wifi_ap_get_fake(old_ap))
ap_add_remove(self, FALSE, old_ap, recheck_available_connections);
ap_add_remove(self,
FALSE,
old_ap,
recheck_available_connections,
recheck_auto_activate);
g_object_unref(old_ap);
}
@ -814,7 +836,8 @@ static void
ap_add_remove(NMDeviceWifi *self,
gboolean is_adding, /* or else removing */
NMWifiAP *ap,
gboolean recheck_available_connections)
gboolean recheck_available_connections,
gboolean recheck_auto_activate)
{
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
@ -845,13 +868,14 @@ ap_add_remove(NMDeviceWifi *self,
nm_dbus_object_clear_and_unexport(&ap);
}
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
if (recheck_auto_activate)
nm_device_recheck_auto_activate_schedule(NM_DEVICE(self));
if (recheck_available_connections)
nm_device_recheck_available_connections(NM_DEVICE(self));
}
static void
remove_all_aps(NMDeviceWifi *self)
remove_all_aps(NMDeviceWifi *self, gboolean disposing)
{
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE(self);
NMWifiAP *ap;
@ -859,12 +883,13 @@ remove_all_aps(NMDeviceWifi *self)
if (c_list_is_empty(&priv->aps_lst_head))
return;
set_current_ap(self, NULL, FALSE);
set_current_ap(self, NULL, FALSE, !disposing);
while ((ap = c_list_first_entry(&priv->aps_lst_head, NMWifiAP, aps_lst)))
ap_add_remove(self, FALSE, ap, FALSE);
ap_add_remove(self, FALSE, ap, FALSE, !disposing);
nm_device_recheck_available_connections(NM_DEVICE(self));
if (!disposing)
nm_device_recheck_available_connections(NM_DEVICE(self));
}
static gboolean
@ -951,7 +976,7 @@ deactivate(NMDevice *device)
priv->rate = 0;
set_current_ap(self, NULL, TRUE);
set_current_ap(self, NULL, TRUE, TRUE);
if (!wake_on_wlan_restore(self))
_LOGW(LOGD_DEVICE | LOGD_WIFI, "Cannot unconfigure WoWLAN.");
@ -2000,7 +2025,7 @@ supplicant_iface_bss_changed_cb(NMSupplicantInterface *iface,
if (nm_wifi_ap_set_fake(found_ap, TRUE))
_ap_dump(self, LOGL_DEBUG, found_ap, "updated", 0);
} else {
ap_add_remove(self, FALSE, found_ap, TRUE);
ap_add_remove(self, FALSE, found_ap, TRUE, TRUE);
schedule_ap_list_dump(self);
}
return;
@ -2043,7 +2068,7 @@ supplicant_iface_bss_changed_cb(NMSupplicantInterface *iface,
}
}
ap_add_remove(self, TRUE, ap, TRUE);
ap_add_remove(self, TRUE, ap, TRUE, TRUE);
}
/* Update the current AP if the supplicant notified a current BSS change
@ -2268,7 +2293,7 @@ link_timeout_cb(gpointer user_data)
if (nm_device_get_state(device) != NM_DEVICE_STATE_ACTIVATED)
return FALSE;
set_current_ap(self, NULL, TRUE);
set_current_ap(self, NULL, TRUE, TRUE);
nm_device_state_changed(device,
NM_DEVICE_STATE_FAILED,
@ -2387,6 +2412,9 @@ handle_8021x_or_psk_auth_fail(NMDeviceWifi *self,
g_return_val_if_fail(new_state == NM_SUPPLICANT_INTERFACE_STATE_DISCONNECTED, FALSE);
if (nm_device_get_state(device) != NM_DEVICE_STATE_CONFIG)
return FALSE;
req = nm_device_get_act_request(NM_DEVICE(self));
g_return_val_if_fail(req != NULL, FALSE);
@ -2684,7 +2712,7 @@ supplicant_iface_notify_current_bss(NMSupplicantInterface *iface,
}
}
set_current_ap(self, new_ap, TRUE);
set_current_ap(self, new_ap, TRUE, TRUE);
req = nm_device_get_act_request(NM_DEVICE(self));
if (req) {
@ -2830,6 +2858,62 @@ handle_auth_or_fail(NMDeviceWifi *self, NMActRequest *req, gboolean new_secrets)
return TRUE;
}
static void
supplicant_iface_notify_wpa_psk_mismatch_cb(NMSupplicantInterface *iface, NMDeviceWifi *self)
{
NMDevice *device = NM_DEVICE(self);
NMActRequest *req;
const char *setting_name = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;
if (nm_device_get_state(device) != NM_DEVICE_STATE_CONFIG)
return;
_LOGI(LOGD_DEVICE | LOGD_WIFI,
"Activation: (wifi) psk mismatch reported by supplicant, asking for new key");
req = nm_device_get_act_request(NM_DEVICE(self));
g_return_if_fail(req != NULL);
nm_act_request_clear_secrets(req);
cleanup_association_attempt(self, TRUE);
nm_device_state_changed(device,
NM_DEVICE_STATE_NEED_AUTH,
NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
wifi_secrets_get_secrets(self,
setting_name,
NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION
| NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW);
}
static void
supplicant_iface_notify_wpa_sae_mismatch_cb(NMSupplicantInterface *iface, NMDeviceWifi *self)
{
NMDevice *device = NM_DEVICE(self);
NMActRequest *req;
const char *setting_name = NM_SETTING_WIRELESS_SECURITY_SETTING_NAME;
if (nm_device_get_state(device) != NM_DEVICE_STATE_CONFIG)
return;
_LOGI(LOGD_DEVICE | LOGD_WIFI,
"Activation: (wifi) SAE password mismatch reported by supplicant, asking for new key");
req = nm_device_get_act_request(NM_DEVICE(self));
g_return_if_fail(req != NULL);
nm_act_request_clear_secrets(req);
cleanup_association_attempt(self, TRUE);
nm_device_state_changed(device,
NM_DEVICE_STATE_NEED_AUTH,
NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
wifi_secrets_get_secrets(self,
setting_name,
NM_SECRET_AGENT_GET_SECRETS_FLAG_ALLOW_INTERACTION
| NM_SECRET_AGENT_GET_SECRETS_FLAG_REQUEST_NEW);
}
/*
* supplicant_connection_timeout_cb
*
@ -3120,7 +3204,7 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
priv->mode = _NM_802_11_MODE_AP;
/* Scanning not done in AP mode; clear the scan list */
remove_all_aps(self);
remove_all_aps(self, FALSE);
} else if (g_strcmp0(mode, NM_SETTING_WIRELESS_MODE_MESH) == 0)
priv->mode = _NM_802_11_MODE_MESH;
_notify(self, PROP_MODE);
@ -3157,14 +3241,14 @@ act_stage1_prepare(NMDevice *device, NMDeviceStateReason *out_failure_reason)
nm_wifi_ap_set_address(ap_fake, nm_device_get_hw_address(device));
g_object_freeze_notify(G_OBJECT(self));
ap_add_remove(self, TRUE, ap_fake, TRUE);
ap_add_remove(self, TRUE, ap_fake, TRUE, TRUE);
g_object_thaw_notify(G_OBJECT(self));
ap = ap_fake;
}
_scan_notify_allowed(self, NM_TERNARY_DEFAULT);
set_current_ap(self, ap, FALSE);
set_current_ap(self, ap, FALSE, TRUE);
nm_active_connection_set_specific_object(NM_ACTIVE_CONNECTION(req),
nm_dbus_object_get_path(NM_DBUS_OBJECT(ap)));
return NM_ACT_STAGE_RETURN_SUCCESS;
@ -3530,7 +3614,7 @@ device_state_changed(NMDevice *device,
cleanup_association_attempt(self, TRUE);
cleanup_supplicant_failures(self);
remove_all_aps(self);
remove_all_aps(self, FALSE);
}
switch (new_state) {
@ -3568,7 +3652,7 @@ device_state_changed(NMDevice *device,
}
if (clear_aps)
remove_all_aps(self);
remove_all_aps(self, FALSE);
_scan_notify_allowed(self, NM_TERNARY_DEFAULT);
}
@ -3810,7 +3894,7 @@ dispose(GObject *object)
g_clear_object(&priv->sup_mgr);
remove_all_aps(self);
remove_all_aps(self, TRUE);
if (priv->p2p_device) {
/* Destroy the P2P device. */

View file

@ -684,7 +684,7 @@ iwd_config_write(GKeyFile *config,
* in the last few filename characters -- it cannot end in .open, .psk
* or .8021x.
*/
return nm_utils_file_set_contents(filepath, data, length, 0600, times, NULL, error);
return nm_utils_file_set_contents(filepath, data, length, 0600, times, NULL, NULL, error);
}
static const char *

View file

@ -508,8 +508,9 @@ find_gsm_apn_cb(const char *apn,
static gboolean
try_create_connect_properties(NMModemBroadband *self)
{
NMModemBroadbandPrivate *priv = NM_MODEM_BROADBAND_GET_PRIVATE(self);
ConnectContext *ctx = priv->ctx;
NMModemBroadbandPrivate *priv = NM_MODEM_BROADBAND_GET_PRIVATE(self);
ConnectContext *ctx = priv->ctx;
NMDeviceStateReason fail_reason = NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED;
if (MODEM_CAPS_3GPP(ctx->caps)) {
NMSettingGsm *s_gsm = nm_connection_get_setting_gsm(ctx->connection);
@ -522,7 +523,7 @@ try_create_connect_properties(NMModemBroadband *self)
if (s_gsm)
network_id = nm_setting_gsm_get_network_id(s_gsm);
if (!network_id) {
if (mm_modem_get_state(self->_priv.modem_iface) < MM_MODEM_STATE_REGISTERED)
if (mm_modem_get_state(self->_priv.modem_iface) != MM_MODEM_STATE_REGISTERED)
return FALSE;
modem_3gpp = mm_object_get_modem_3gpp(priv->modem_object);
network_id = mm_modem_3gpp_get_operator_code(modem_3gpp);
@ -530,6 +531,7 @@ try_create_connect_properties(NMModemBroadband *self)
if (!network_id) {
_LOGW("failed to connect '%s': unable to determine the network id",
nm_connection_get_id(ctx->connection));
fail_reason = NM_DEVICE_STATE_REASON_MODEM_NO_OPERATOR_CODE;
goto out;
}
@ -558,7 +560,7 @@ try_create_connect_properties(NMModemBroadband *self)
}
out:
nm_modem_emit_prepare_result(NM_MODEM(self), FALSE, NM_DEVICE_STATE_REASON_MODEM_INIT_FAILED);
nm_modem_emit_prepare_result(NM_MODEM(self), FALSE, fail_reason);
connect_context_clear(self);
return TRUE;
}
@ -1649,6 +1651,8 @@ nm_modem_broadband_new(GObject *object, GError **error)
driver,
NM_MODEM_OPERATOR_CODE,
operator_code,
NM_MODEM_DEVICE_UID,
mm_modem_get_device(modem_iface),
NULL);
}

View file

@ -39,7 +39,8 @@ NM_GOBJECT_PROPERTIES_DEFINE(NMModem,
PROP_IP_TYPES,
PROP_SIM_OPERATOR_ID,
PROP_OPERATOR_CODE,
PROP_APN, );
PROP_APN,
PROP_DEVICE_UID, );
enum {
PPP_STATS,
@ -78,6 +79,7 @@ typedef struct _NMModemPrivate {
char *sim_operator_id;
char *operator_code;
char *apn;
char *device_uid;
NMPPPManager *ppp_manager;
NMPppMgr *ppp_mgr;
@ -618,6 +620,12 @@ nm_modem_get_apn(NMModem *self)
return NM_MODEM_GET_PRIVATE(self)->apn;
}
const char *
nm_modem_get_device_uid(NMModem *self)
{
return NM_MODEM_GET_PRIVATE(self)->device_uid;
}
/*****************************************************************************/
static void
@ -1121,6 +1129,22 @@ nm_modem_check_connection_compatible(NMModem *self, NMConnection *connection, GE
}
}
str = nm_setting_gsm_get_device_uid(s_gsm);
if (str) {
if (!priv->device_uid) {
nm_utils_error_set_literal(error,
NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
"GSM profile has device-uid, device does not");
return FALSE;
}
if (!nm_streq(str, priv->device_uid)) {
nm_utils_error_set_literal(error,
NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY,
"device has differing device-uid than GSM profile");
return FALSE;
}
}
/* SIM properties may not be available before the SIM is unlocked, so
* to ensure that autoconnect works, the connection's SIM properties
* are only compared if present on the device.
@ -1644,6 +1668,9 @@ get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
case PROP_APN:
g_value_set_string(value, priv->apn);
break;
case PROP_DEVICE_UID:
g_value_set_string(value, priv->device_uid);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@ -1699,6 +1726,10 @@ set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *ps
/* construct-only */
priv->operator_code = g_value_dup_string(value);
break;
case PROP_DEVICE_UID:
/* construct-only */
priv->device_uid = g_value_dup_string(value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
@ -1758,6 +1789,7 @@ finalize(GObject *object)
g_free(priv->sim_operator_id);
g_free(priv->operator_code);
g_free(priv->apn);
g_free(priv->device_uid);
G_OBJECT_CLASS(nm_modem_parent_class)->finalize(object);
}
@ -1863,6 +1895,13 @@ nm_modem_class_init(NMModemClass *klass)
obj_properties[PROP_APN] =
g_param_spec_string(NM_MODEM_APN, "", "", NULL, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
obj_properties[PROP_DEVICE_UID] =
g_param_spec_string(NM_MODEM_DEVICE_UID,
"",
"",
NULL,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
signals[PPP_STATS] = g_signal_new(NM_MODEM_PPP_STATS,

View file

@ -30,6 +30,7 @@
#define NM_MODEM_SIM_OPERATOR_ID "sim-operator-id"
#define NM_MODEM_OPERATOR_CODE "operator-code"
#define NM_MODEM_APN "apn"
#define NM_MODEM_DEVICE_UID "device-uid"
/* Signals */
#define NM_MODEM_PPP_STATS "ppp-stats"
@ -154,6 +155,7 @@ const char *nm_modem_get_sim_id(NMModem *modem);
const char *nm_modem_get_sim_operator_id(NMModem *modem);
const char *nm_modem_get_operator_code(NMModem *modem);
const char *nm_modem_get_apn(NMModem *modem);
const char *nm_modem_get_device_uid(NMModem *modem);
gboolean nm_modem_set_data_port(NMModem *self,
NMPlatform *platform,

View file

@ -68,7 +68,7 @@ const NMDhcpOption _nm_dhcp_option_dhcp4_options[] = {
REQ(NM_DHCP_OPTION_DHCP4_ARP_CACHE_TIMEOUT, "arp_cache_timeout", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_IEEE802_3_ENCAPSULATION, "ieee802_3_encapsulation", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_DEFAULT_TCP_TTL, "default_tcp_ttl", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_TCP_KEEPALIVE_INTERVAL, "tcp_keepalive_internal", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_TCP_KEEPALIVE_INTERVAL, "tcp_keepalive_interval", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_TCP_KEEPALIVE_GARBAGE, "tcp_keepalive_garbage", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_VENDOR_SPECIFIC, "vendor_encapsulated_options", FALSE),
REQ(NM_DHCP_OPTION_DHCP4_NETBIOS_NAMESERVER, "netbios_name_servers", FALSE),

View file

@ -395,7 +395,7 @@ ip6_start(NMDhcpClient *client, const struct in6_addr *ll_addr, GError **error)
prefix_delegation = FALSE;
if (client_config->v6.needed_prefixes > 0) {
if (client_config->v6.needed_prefixes > 1) {
/* FIXME: systemd-networkd API only allows to request a
/* FIXME: systemd-networkd API only allows requesting a
* single prefix */
_LOGW("dhcp-client6: only one prefix request is supported");
}

View file

@ -32,11 +32,11 @@ ip4_process_dhcpcd_rfc3442_routes(const char *iface,
in_addr_t address,
guint32 *out_gwaddr)
{
gs_free const char **routes = NULL;
const char **r;
gboolean have_routes = FALSE;
gs_free char **routes = NULL;
char **r;
gboolean have_routes = FALSE;
routes = nm_strsplit_set(str, " ");
routes = (char **) nm_strsplit_set(str, " ");
if (!routes)
return FALSE;
@ -1224,7 +1224,7 @@ lease_option_print_domain_name(const uint8_t *cache,
}
case 0xC0: /* back pointer */
{
size_t offset = (c & 0x3F) << 16;
size_t offset = (c & 0x3F) << 8;
/*
* The offset is given as two bytes (in big endian), where the

View file

@ -239,6 +239,76 @@ test_parse_search_list(void)
g_assert_cmpint(g_strv_length(domains), ==, 1);
g_assert_cmpstr(domains[0], ==, "okay");
g_strfreev(domains);
/* Test that the message compression works when the offset uses both bytes */
data = (guint8[]) {
/* clang-format off */
/* offset 0 */
0x3e,
'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a',
'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a',
'a','a','a','a','a','a','a','a','a','a','a','a','a','a','a','a',
'a','a','a','a','a','a','a','a','a','a','a','a','a','a',
0x00,
/* offset 0x40 */
0x3e,
'b','b','b','b','b','b','b','b','b','b','b','b','b','b','b','b',
'b','b','b','b','b','b','b','b','b','b','b','b','b','b','b','b',
'b','b','b','b','b','b','b','b','b','b','b','b','b','b','b','b',
'b','b','b','b','b','b','b','b','b','b','b','b','b','b',
0x00,
/* offset 0x80 */
0x3e,
'c','c','c','c','c','c','c','c','c','c','c','c','c','c','c','c',
'c','c','c','c','c','c','c','c','c','c','c','c','c','c','c','c',
'c','c','c','c','c','c','c','c','c','c','c','c','c','c','c','c',
'c','c','c','c','c','c','c','c','c','c','c','c','c','c',
0x00,
/* offset 0xc0 */
0x3e,
'd','d','d','d','d','d','d','d','d','d','d','d','d','d','d','d',
'd','d','d','d','d','d','d','d','d','d','d','d','d','d','d','d',
'd','d','d','d','d','d','d','d','d','d','d','d','d','d','d','d',
'd','d','d','d','d','d','d','d','d','d','d','d','d','d',
0x00,
/* offset 0x100 */
0x3e,
'e','e','e','e','e','e','e','e','e','e','e','e','e','e','e','e',
'e','e','e','e','e','e','e','e','e','e','e','e','e','e','e','e',
'e','e','e','e','e','e','e','e','e','e','e','e','e','e','e','e',
'e','e','e','e','e','e','e','e','e','e','e','e','e','e',
0x00,
/* offset 0x140 */
0x06, 'f','o','o','b','a','r', 0x03, 'c', 'o', 'm', 0x00,
0x04, 't', 'e', 's', 't', 0xc1, 0x40, /* back pointer to offset 0x140*/
/* clang-format on */
};
domains = nm_dhcp_lease_data_parse_search_list(data,
0x153,
"eth0",
AF_INET,
NM_DHCP_OPTION_DHCP4_DOMAIN_SEARCH_LIST);
g_assert(domains);
g_assert_cmpint(g_strv_length(domains), ==, 7);
g_assert_cmpstr(domains[0],
==,
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
g_assert_cmpstr(domains[1],
==,
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
g_assert_cmpstr(domains[2],
==,
"cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc");
g_assert_cmpstr(domains[3],
==,
"dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd");
g_assert_cmpstr(domains[4],
==,
"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
g_assert_cmpstr(domains[5], ==, "foobar.com");
g_assert_cmpstr(domains[6], ==, "test.foobar.com");
g_strfreev(domains);
}
static void

View file

@ -368,12 +368,13 @@ server_builder_append_base(GVariantBuilder *argument_builder,
const char *address_string,
const char *const *routing_domains,
const char *const *search_domains,
const char *ca)
const char *ca,
int priority)
{
NMDnsServer dns_server;
gsize addr_size;
if (!nm_dns_uri_parse(address_family, address_string, &dns_server))
if (!nm_dns_uri_parse(address_family, address_string, &dns_server, NULL))
return FALSE;
addr_size = nm_utils_addr_family_to_size(dns_server.addr_family);
@ -392,6 +393,12 @@ server_builder_append_base(GVariantBuilder *argument_builder,
"{sv}",
"name",
g_variant_new("s", dns_server.servername));
if (dns_server.port != NM_DNS_PORT_UNDEFINED) {
g_variant_builder_add(argument_builder,
"{sv}",
"port",
g_variant_new("i", dns_server.port));
}
if (routing_domains) {
g_variant_builder_add(argument_builder,
"{sv}",
@ -407,6 +414,9 @@ server_builder_append_base(GVariantBuilder *argument_builder,
if (ca) {
g_variant_builder_add(argument_builder, "{sv}", "ca", g_variant_new("s", ca));
}
/* dnsconfd defines priority as bigger number equals bigger priority, while NM
* uses the exact opposite, thus use -priority */
g_variant_builder_add(argument_builder, "{sv}", "priority", g_variant_new("i", -priority));
return TRUE;
}
@ -443,7 +453,8 @@ parse_global_config(const NMGlobalDnsConfig *global_config,
servers[j],
routing_domains,
searches,
*ca)) {
*ca,
NM_DNS_PRIORITY_DEFAULT_NORMAL)) {
g_variant_builder_close(argument_builder);
}
}
@ -560,7 +571,7 @@ dnsconfd_start_done(GObject *source_object, GAsyncResult *res, gpointer user_dat
g_dbus_error_strip_remote_error(error);
_LOGW("failed to start Dnsconfd %s", error->message);
} else {
_LOGT("succesfully started Dnsconfd");
_LOGT("successfully started Dnsconfd");
}
/* No update maybe changed or state change, as this is handled by the name owner callbacks
@ -628,6 +639,7 @@ parse_all_interface_config(GVariantBuilder *argument_builder,
NMDnsConfigIPData *ip_data;
const char *const *dns_server_strings;
guint nameserver_count;
int priority;
const char *ifname;
gboolean explicit_default = is_default_interface_explicit(ip_data_lst_head);
@ -648,6 +660,9 @@ parse_all_interface_config(GVariantBuilder *argument_builder,
gather_interface_domains(ip_data, explicit_default, &routing_domains, &search_domains);
get_networks(ip_data, &networks);
if (!nm_l3_config_data_get_dns_priority(ip_data->l3cd, ip_data->addr_family, &priority)) {
priority = NM_DNS_PRIORITY_DEFAULT_NORMAL;
}
for (guint i = 0; i < nameserver_count; i++) {
if (server_builder_append_base(argument_builder,
@ -655,7 +670,8 @@ parse_all_interface_config(GVariantBuilder *argument_builder,
dns_server_strings[i],
routing_domains,
search_domains,
ca)) {
ca,
priority)) {
server_builder_append_interface_info(argument_builder, ifname, networks);
}
}

View file

@ -521,9 +521,10 @@ _gl_pid_spawn_next_step(void)
argv[argv_idx++] = "--no-resolv"; /* Use only commandline */
argv[argv_idx++] = "--keep-in-foreground";
argv[argv_idx++] = "--no-hosts"; /* don't use /etc/hosts to resolve */
argv[argv_idx++] = "--bind-interfaces";
argv[argv_idx++] = "--bind-dynamic";
argv[argv_idx++] = "--pid-file=" PIDFILE;
argv[argv_idx++] = "--listen-address=127.0.0.1"; /* Should work for both 4 and 6 */
argv[argv_idx++] = "--listen-address=127.0.0.1";
argv[argv_idx++] = "--listen-address=::1";
argv[argv_idx++] = "--cache-size=400";
argv[argv_idx++] = "--clear-on-reload"; /* clear cache when dns server changes */
argv[argv_idx++] = "--conf-file=/dev/null"; /* avoid loading /etc/dnsmasq.conf */

View file

@ -26,6 +26,7 @@
#include "libnm-core-intern/nm-core-internal.h"
#include "libnm-glib-aux/nm-str-buf.h"
#include "libnm-glib-aux/nm-io-utils.h"
#include "NetworkManagerUtils.h"
#include "devices/nm-device.h"
@ -586,7 +587,11 @@ add_dns_domains(GPtrArray *array,
}
static void
merge_one_l3cd(NMResolvConfData *rc, int addr_family, int ifindex, const NML3ConfigData *l3cd)
merge_one_l3cd(NMResolvConfData *rc,
int addr_family,
int ifindex,
const NML3ConfigData *l3cd,
gboolean ignore_searches_and_options)
{
char buf[NM_INET_ADDRSTRLEN + 50];
gboolean has_trust_ad;
@ -624,30 +629,32 @@ merge_one_l3cd(NMResolvConfData *rc, int addr_family, int ifindex, const NML3Con
add_string_item(rc->nameservers, buf, TRUE);
}
add_dns_domains(rc->searches, addr_family, l3cd, FALSE, TRUE);
if (!ignore_searches_and_options) {
add_dns_domains(rc->searches, addr_family, l3cd, FALSE, TRUE);
has_trust_ad = FALSE;
strarr = nm_l3_config_data_get_dns_options(l3cd, addr_family, &num);
for (i = 0; i < num; i++) {
const char *option = strarr[i];
has_trust_ad = FALSE;
strarr = nm_l3_config_data_get_dns_options(l3cd, addr_family, &num);
for (i = 0; i < num; i++) {
const char *option = strarr[i];
if (nm_streq(option, NM_SETTING_DNS_OPTION_TRUST_AD)) {
has_trust_ad = TRUE;
continue;
if (nm_streq(option, NM_SETTING_DNS_OPTION_TRUST_AD)) {
has_trust_ad = TRUE;
continue;
}
add_dns_option_item(rc->options, option);
}
add_dns_option_item(rc->options, option);
}
if (num_nameservers == 0) {
/* If the @l3cd contributes no DNS servers, ignore whether trust-ad is set or unset
* for this @l3cd. */
} else if (has_trust_ad) {
/* We only set has_trust_ad to TRUE, if all IP configs agree (or don't contribute).
* Once set to FALSE, it doesn't get reset. */
if (rc->has_trust_ad == NM_TERNARY_DEFAULT)
rc->has_trust_ad = NM_TERNARY_TRUE;
} else
rc->has_trust_ad = NM_TERNARY_FALSE;
if (num_nameservers == 0) {
/* If the @l3cd contributes no DNS servers, ignore whether trust-ad is set or unset
* for this @l3cd. */
} else if (has_trust_ad) {
/* We only set has_trust_ad to TRUE, if all IP configs agree (or don't contribute).
* Once set to FALSE, it doesn't get reset. */
if (rc->has_trust_ad == NM_TERNARY_DEFAULT)
rc->has_trust_ad = NM_TERNARY_TRUE;
} else
rc->has_trust_ad = NM_TERNARY_FALSE;
}
if (addr_family == AF_INET) {
const in_addr_t *nis_servers;
@ -1000,7 +1007,8 @@ _read_link_cached(const char *path, gboolean *is_cached, char **cached)
#define MY_RESOLV_CONF_TMP MY_RESOLV_CONF ".tmp"
#define RESOLV_CONF_TMP "/etc/.resolv.conf.NetworkManager"
#define NO_STUB_RESOLV_CONF NMRUNDIR "/no-stub-resolv.conf"
#define NO_STUB_RESOLV_CONF NMRUNDIR "/no-stub-resolv.conf"
#define NO_STUB_RESOLV_CONF_TMP NMRUNDIR "/no-stub-resolv.conf.tmp"
static void
update_resolv_conf_no_stub(NMDnsManager *self,
@ -1013,7 +1021,14 @@ update_resolv_conf_no_stub(NMDnsManager *self,
content = create_resolv_conf(searches, nameservers, options);
if (!g_file_set_contents(NO_STUB_RESOLV_CONF, content, -1, &local)) {
if (!nm_utils_file_set_contents(NO_STUB_RESOLV_CONF,
content,
-1,
0644,
NULL,
NO_STUB_RESOLV_CONF_TMP,
NULL,
&local)) {
_LOGD("update-resolv-no-stub: failure to write file: %s", local->message);
g_error_free(local);
return;
@ -1231,12 +1246,15 @@ compute_hash(NMDnsManager *self, const NMGlobalDnsConfig *global, guint8 buffer[
{
nm_auto_free_checksum GChecksum *sum = NULL;
NMDnsConfigIPData *ip_data;
gboolean has_global_dns_section = FALSE;
sum = g_checksum_new(G_CHECKSUM_SHA1);
nm_assert(HASH_LEN == g_checksum_type_get_length(G_CHECKSUM_SHA1));
if (global)
if (global) {
nm_global_dns_config_update_checksum(global, sum);
has_global_dns_section = nm_global_dns_has_global_dns_section(global);
}
if (!global || !nm_global_dns_config_lookup_domain(global, "*")) {
const CList *head;
@ -1248,7 +1266,8 @@ compute_hash(NMDnsManager *self, const NMGlobalDnsConfig *global, guint8 buffer[
nm_l3_config_data_hash_dns(ip_data->l3cd,
sum,
ip_data->addr_family,
ip_data->ip_config_type);
ip_data->ip_config_type,
has_global_dns_section);
}
}
@ -1264,6 +1283,9 @@ merge_global_dns_config(NMResolvConfData *rc, NMGlobalDnsConfig *global_conf)
const char *const *servers;
guint i;
/* Global config must be processed before connections' config */
nm_assert(rc->nameservers->len == 0);
if (!global_conf)
return FALSE;
@ -1351,12 +1373,17 @@ _collect_resolv_conf_data(NMDnsManager *self,
.nis_servers = g_ptr_array_new(),
.has_trust_ad = NM_TERNARY_DEFAULT,
};
gboolean has_global_dns_section = FALSE;
priv = NM_DNS_MANAGER_GET_PRIVATE(self);
if (global_config)
if (global_config) {
merge_global_dns_config(&rc, global_config);
has_global_dns_section = nm_global_dns_has_global_dns_section(global_config);
}
/* If global nameservers are defined, no DNS configs are used from connections at all,
* including searches and options. */
if (!global_config || !nm_global_dns_config_lookup_domain(global_config, "*")) {
nm_auto_str_buf NMStrBuf tmp_strbuf = NM_STR_BUF_INIT(0, FALSE);
int first_prio = 0;
@ -1390,8 +1417,16 @@ _collect_resolv_conf_data(NMDnsManager *self,
skip ? "<SKIP>" : "",
get_nameserver_list(ip_data->addr_family, ip_data->l3cd, &tmp_strbuf));
if (!skip)
merge_one_l3cd(&rc, ip_data->addr_family, ip_data->data->ifindex, ip_data->l3cd);
if (!skip) {
/* Merge the configs from connections. However, if there was a [global-dns]
* it overwrites searches and options from the connections, thus we only
* merge the nameservers. */
merge_one_l3cd(&rc,
ip_data->addr_family,
ip_data->data->ifindex,
ip_data->l3cd,
has_global_dns_section);
}
}
}
@ -1475,8 +1510,8 @@ _domain_track_is_shadowed(GHashTable *ht,
const char **out_parent,
int *out_parent_priority)
{
char *parent;
int parent_priority;
const char *parent;
int parent_priority;
if (!ht)
return FALSE;

View file

@ -37,6 +37,7 @@
static const char *const DBUS_OP_SET_LINK_DEFAULT_ROUTE = "SetLinkDefaultRoute";
static const char *const DBUS_OP_SET_LINK_DNS_OVER_TLS = "SetLinkDNSOverTLS";
static const char *const DBUS_OP_SET_LINK_DNS_EX = "SetLinkDNSEx";
static const char *const DBUS_OP_SET_LINK_DNSSEC = "SetLinkDNSSEC";
/*****************************************************************************/
@ -398,7 +399,7 @@ update_add_ip_config(NMDnsSystemdResolved *self,
for (i = 0; i < n; i++) {
NMDnsServer dns_server;
if (!nm_dns_uri_parse(ip_data->addr_family, strarr[i], &dns_server))
if (!nm_dns_uri_parse(ip_data->addr_family, strarr[i], &dns_server, NULL))
continue;
if (!NM_IN_SET(dns_server.scheme,
@ -484,9 +485,11 @@ prepare_one_interface(NMDnsSystemdResolved *self, const InterfaceConfig *ic)
NMSettingConnectionMdns mdns = NM_SETTING_CONNECTION_MDNS_DEFAULT;
NMSettingConnectionLlmnr llmnr = NM_SETTING_CONNECTION_LLMNR_DEFAULT;
NMSettingConnectionDnsOverTls dns_over_tls = NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT;
NMSettingConnectionDnssec dnssec = NM_SETTING_CONNECTION_DNSSEC_DEFAULT;
const char *mdns_arg = NULL;
const char *llmnr_arg = NULL;
const char *dns_over_tls_arg = NULL;
const char *dnssec_arg = NULL;
gboolean has_config = FALSE;
gboolean has_default_route = FALSE;
guint i;
@ -517,6 +520,7 @@ prepare_one_interface(NMDnsSystemdResolved *self, const InterfaceConfig *ic)
llmnr = NM_MAX(llmnr, nm_l3_config_data_get_llmnr(ip_data->l3cd));
dns_over_tls =
NM_MAX(dns_over_tls, nm_l3_config_data_get_dns_over_tls(ip_data->l3cd));
dnssec = NM_MAX(dnssec, nm_l3_config_data_get_dnssec(ip_data->l3cd));
}
}
}
@ -589,8 +593,24 @@ prepare_one_interface(NMDnsSystemdResolved *self, const InterfaceConfig *ic)
}
nm_assert(dns_over_tls_arg);
switch (dnssec) {
case NM_SETTING_CONNECTION_DNSSEC_NO:
dnssec_arg = "no";
break;
case NM_SETTING_CONNECTION_DNSSEC_ALLOW_DOWNGRADE:
dnssec_arg = "allow-downgrade";
break;
case NM_SETTING_CONNECTION_DNSSEC_YES:
dnssec_arg = "yes";
break;
case NM_SETTING_CONNECTION_DNSSEC_DEFAULT:
dnssec_arg = "";
break;
}
nm_assert(dnssec_arg);
if (!nm_str_is_empty(mdns_arg) || !nm_str_is_empty(llmnr_arg)
|| !nm_str_is_empty(dns_over_tls_arg))
|| !nm_str_is_empty(dns_over_tls_arg) || !nm_str_is_empty(dnssec_arg))
has_config = TRUE;
_request_item_append(self, "SetLinkDomains", ic->ifindex, g_variant_builder_end(&domains));
@ -618,6 +638,10 @@ prepare_one_interface(NMDnsSystemdResolved *self, const InterfaceConfig *ic)
DBUS_OP_SET_LINK_DNS_OVER_TLS,
ic->ifindex,
g_variant_new("(is)", ic->ifindex, dns_over_tls_arg ?: ""));
_request_item_append(self,
DBUS_OP_SET_LINK_DNSSEC,
ic->ifindex,
g_variant_new("(is)", ic->ifindex, dnssec_arg ?: ""));
return has_config;
}

View file

@ -81,7 +81,7 @@ nm_main_utils_write_pidfile(const char *pidfile)
char pid[16];
nm_sprintf_buf(pid, "%lld", (long long) getpid());
if (!nm_utils_file_set_contents(pidfile, pid, -1, 00644, NULL, NULL, &error)) {
if (!nm_utils_file_set_contents(pidfile, pid, -1, 00644, NULL, NULL, NULL, &error)) {
fprintf(stderr, _("Writing to %s failed: %s\n"), pidfile, error->message);
return FALSE;
}

View file

@ -339,7 +339,7 @@ main(int argc, char *argv[])
char *path, *slash;
int g;
/* exe is <basedir>/src/.libs/lt-NetworkManager, so chop off
/* exe is <builddir>/src/core/NetworkManager, so chop off
* the last three components */
path = realpath("/proc/self/exe", NULL);
g_assert(path != NULL);

View file

@ -19,6 +19,7 @@
#include "libnm-systemd-shared/nm-sd-utils-shared.h"
#include "nm-l3cfg.h"
#include "nm-ndisc-private.h"
#include "nm-core-utils.h"
#define _NMLOG_PREFIX_NAME "ndisc-lndp"
@ -27,6 +28,14 @@
typedef struct {
struct ndp *ndp;
GSource *event_source;
struct {
NMRateLimit pio_lft;
NMRateLimit mtu;
NMRateLimit omit_prefix;
NMRateLimit omit_dns;
NMRateLimit omit_dnssl;
} msg_ratelimit;
} NMLndpNDiscPrivate;
/*****************************************************************************/
@ -49,6 +58,36 @@ G_DEFINE_TYPE(NMLndpNDisc, nm_lndp_ndisc, NM_TYPE_NDISC)
/*****************************************************************************/
/*
* If we log a message about an invalid RA packet, don't repeat the same message
* at every packet received or sent. Rate limit the message to 6 every 12 hours
* per type and per ndisc instance.
*/
#define LOG_INV_RA_WINDOW (12 * 3600)
#define LOG_INV_RA_BURST 6
#define _LOG_INVALID_RA(ndisc, rate_limit, ...) \
G_STMT_START \
{ \
NMNDisc *__ndisc = (ndisc); \
NMRateLimit *__rl = (rate_limit); \
const char *__ifname = nm_ndisc_get_ifname(__ndisc); \
\
if (__ifname && nm_logging_enabled(LOGL_WARN, LOGD_IP6) \
&& nm_rate_limit_check(__rl, LOG_INV_RA_WINDOW, LOG_INV_RA_BURST)) { \
nm_log(LOGL_WARN, \
LOGD_IP6, \
__ifname, \
NULL, \
"ndisc (%s): " _NM_UTILS_MACRO_FIRST(__VA_ARGS__), \
__ifname _NM_UTILS_MACRO_REST(__VA_ARGS__)); \
} \
} \
G_STMT_END
/*****************************************************************************/
static gboolean
send_rs(NMNDisc *ndisc, GError **error)
{
@ -113,6 +152,7 @@ static int
receive_ra(struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
{
NMNDisc *ndisc = (NMNDisc *) user_data;
NMLndpNDiscPrivate *priv = NM_LNDP_NDISC_GET_PRIVATE(ndisc);
NMNDiscDataInternal *rdata = ndisc->rdata;
NMNDiscConfigMap changed = 0;
NMNDiscGateway gateway;
@ -218,10 +258,26 @@ receive_ra(struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
/* Address */
if (r_plen == 64 && ndp_msg_opt_prefix_flag_auto_addr_conf(msg, offset)) {
const guint32 valid_time = ndp_msg_opt_prefix_valid_time(msg, offset);
const guint32 preferred_time =
NM_MIN(ndp_msg_opt_prefix_preferred_time(msg, offset), valid_time);
const NMNDiscAddress address = {
const guint32 valid_time = ndp_msg_opt_prefix_valid_time(msg, offset);
const guint32 preferred_time = ndp_msg_opt_prefix_preferred_time(msg, offset);
NMNDiscAddress address;
/*
* RFC 4862 Section 5.5.3 states:
* c) If the preferred lifetime is greater than the valid lifetime,
* silently ignore the Prefix Information option. A node MAY wish to
* log a system management error in this case.
*/
if (preferred_time > valid_time) {
_LOG_INVALID_RA(
ndisc,
&priv->msg_ratelimit.pio_lft,
"ignoring Prefix Information Option with invalid lifetimes in received IPv6 "
"router advertisement");
continue;
}
address = (NMNDiscAddress) {
.address = r_network,
.expiry_msec = _nm_ndisc_lifetime_to_expiry(now_msec, valid_time),
.expiry_preferred_msec = _nm_ndisc_lifetime_to_expiry(now_msec, preferred_time),
@ -337,7 +393,11 @@ receive_ra(struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
* Kernel would set it, but would flush out all IPv6 addresses away
* from the link, even the link-local, and we wouldn't be able to
* listen for further RAs that could fix the MTU. */
_LOGW("MTU too small for IPv6 ignored: %d", mtu);
_LOG_INVALID_RA(ndisc,
&priv->msg_ratelimit.mtu,
"ignoring too small MTU %u in received IPv6 "
"router advertisement",
mtu);
}
}
@ -433,8 +493,11 @@ send_ra(NMNDisc *ndisc, GError **error)
prefix = _ndp_msg_add_option(msg, sizeof(*prefix));
if (!prefix) {
/* Maybe we could sent separate RAs, but why bother... */
_LOGW("The RA is too big, had to omit some some prefixes.");
/* Maybe we could send separate RAs, but why bother... */
_LOG_INVALID_RA(
ndisc,
&priv->msg_ratelimit.omit_prefix,
"the outgoing IPv6 router advertisement is too big: omitting some prefixes");
break;
}
@ -463,7 +526,10 @@ send_ra(NMNDisc *ndisc, GError **error)
option = _ndp_msg_add_option(msg, len);
if (!option) {
_LOGW("The RA is too big, had to omit DNS information.");
_LOG_INVALID_RA(
ndisc,
&priv->msg_ratelimit.omit_dns,
"the outgoing IPv6 router advertisement is too big: omitting DNS information");
goto dns_servers_done;
}
@ -541,7 +607,10 @@ dns_servers_done:
nm_assert(len / 8u >= 2u);
if (len / 8u >= 256u || !(option = _ndp_msg_add_option(msg, len))) {
_LOGW("The RA is too big, had to omit DNS search list.");
_LOG_INVALID_RA(
ndisc,
&priv->msg_ratelimit.omit_dnssl,
"the outgoing IPv6 router advertisement is too big: omitting DNS search list");
goto dns_domains_done;
}

View file

@ -1490,7 +1490,7 @@ clean_addresses(NMNDisc *ndisc, gint64 now_msec, NMNDiscConfigMap *changed, gint
g_array_set_size(rdata->addresses, j);
}
if (_array_set_size_max(rdata->gateways, priv->config.max_addresses))
if (_array_set_size_max(rdata->addresses, priv->config.max_addresses))
*changed |= NM_NDISC_CONFIG_ADDRESSES;
}
@ -1830,7 +1830,7 @@ _config_init(NMNDiscConfig *config, const NMNDiscConfig *src)
nm_assert(config);
g_return_if_fail(src);
/* we only allow to set @config if it was cleared (or is not yet initialized). */
/* we only allow one to set @config if it was cleared (or is not yet initialized). */
nm_assert(!config->l3cfg);
nm_assert(!config->ifname);
nm_assert(!config->network_id);

View file

@ -916,21 +916,21 @@ nm_bond_manager_send_arp(int bond_ifindex,
if (announce_fdb) {
/* if we are announcing the FDB we do a RARP, we don't set the
* source/dest IPv4 address */
int ifindexes[] = {bridge_ifindex, bond_ifindex};
int i;
gs_free NMEtherAddr **fdb_addrs = NULL;
int ifindexes[] = {bridge_ifindex, bond_ifindex};
int i;
nm_auto_freev NMEtherAddr **fdb_addrs = NULL;
fdb_addrs = nm_linux_platform_get_link_fdb_table(platform, ifindexes, 2);
fdb_addrs = nm_linux_platform_get_bridge_fdb(platform, ifindexes, 2);
/* we want to send a Reverse ARP (RARP) packet */
data.op = htons(ARP_OP_RARP);
i = 0;
while (fdb_addrs[i] != NULL) {
NMEtherAddr *tmp_hwaddr = fdb_addrs[i];
memcpy(data.s_hw_addr, tmp_hwaddr, ETH_ALEN);
memcpy(data.d_hw_addr, tmp_hwaddr, ETH_ALEN);
memcpy(data.s_addr, tmp_hwaddr, ETH_ALEN);
g_free(tmp_hwaddr);
if (sendto(sockfd, &data, sizeof(data), 0, (struct sockaddr *) &addr, sizeof(addr)) < 0)
return FALSE;
i++;

View file

@ -160,7 +160,7 @@ parse_connection_from_shadowed_file(const char *path, GError **error)
{
nm_auto_unref_keyfile GKeyFile *keyfile = NULL;
gs_free char *base_dir = NULL;
char *sep;
const char *sep;
keyfile = g_key_file_new();
if (!g_key_file_load_from_file(keyfile, path, G_KEY_FILE_NONE, error))

View file

@ -50,9 +50,9 @@ struct _NMGlobalDnsConfig {
char **options;
GHashTable *domains;
const char **domain_list;
gboolean internal;
char *cert_authority;
NMDnsResolveMode resolve_mode;
gboolean internal;
};
/*****************************************************************************/
@ -941,6 +941,14 @@ next:
/*****************************************************************************/
gboolean
nm_global_dns_has_global_dns_section(const NMGlobalDnsConfig *dns_config)
{
g_return_val_if_fail(dns_config, FALSE);
return dns_config->searches != NULL || dns_config->options != NULL;
}
const char *const *
nm_global_dns_config_get_searches(const NMGlobalDnsConfig *dns_config)
{
@ -1236,6 +1244,7 @@ load_global_dns(GKeyFile *keyfile, gboolean internal)
gs_free char *cert_authority = NULL;
gs_free char *resolve_mode = NULL;
NMDnsResolveMode parsed_resolve_mode;
gboolean has_global_dns_section;
if (internal) {
group = NM_CONFIG_KEYFILE_GROUP_INTERN_GLOBAL_DNS;
@ -1386,6 +1395,22 @@ load_global_dns(GKeyFile *keyfile, gboolean internal)
return NULL;
}
/* Defining [global-dns-domain-*] implies defining [global-dns] too (maybe empty) */
if (default_found)
has_global_dns_section = TRUE;
else
has_global_dns_section = g_key_file_has_group(keyfile, group);
/* If there exist a [global-dns] section, always initialize "searches" and "options" so
* they appear in D-Bus. Clients can use this to know if it's defined, so they can know
* if DNS configs from connections are relevant or not. */
if (has_global_dns_section) {
if (!dns_config->searches)
dns_config->searches = nm_strv_empty_new();
if (!dns_config->options)
dns_config->options = nm_strv_empty_new();
}
dns_config->internal = internal;
global_dns_config_seal_domains(dns_config);
return dns_config;
@ -1606,17 +1631,6 @@ nm_global_dns_config_from_dbus(const GValue *value, GError **error)
g_variant_unref(val);
}
/* An empty value is valid and clears the internal configuration */
if (!nm_global_dns_config_is_empty(dns_config)
&& !nm_global_dns_config_lookup_domain(dns_config, "*")) {
g_set_error_literal(error,
NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
"Global DNS configuration is missing the default domain");
nm_global_dns_config_free(dns_config);
return NULL;
}
global_dns_config_seal_domains(dns_config);
return dns_config;
}

View file

@ -274,6 +274,7 @@ gboolean nm_config_data_is_intern_atomic_group(const NMConfigData *self, const c
GKeyFile *nm_config_data_clone_keyfile_intern(const NMConfigData *self);
gboolean nm_global_dns_has_global_dns_section(const NMGlobalDnsConfig *dns_config);
const char *const *nm_global_dns_config_get_searches(const NMGlobalDnsConfig *dns_config);
const char *const *nm_global_dns_config_get_options(const NMGlobalDnsConfig *dns_config);
const char *nm_global_dns_config_get_certification_authority(const NMGlobalDnsConfig *dns_config);

View file

@ -18,6 +18,7 @@
#include "libnm-core-intern/nm-core-internal.h"
#include "libnm-core-intern/nm-keyfile-internal.h"
#include "libnm-core-intern/nm-keyfile-utils.h"
#include "libnm-glib-aux/nm-keyfile-aux.h"
#define DEFAULT_CONFIG_MAIN_FILE NMCONFDIR "/NetworkManager.conf"
#define DEFAULT_CONFIG_DIR NMCONFDIR "/conf.d"
@ -891,6 +892,7 @@ static const ConfigGroup config_groups[] = {
.is_prefix = TRUE,
.keys = NM_MAKE_STRV(NM_CONFIG_KEYFILE_KEY_DEVICE_CARRIER_WAIT_TIMEOUT,
NM_CONFIG_KEYFILE_KEY_DEVICE_IGNORE_CARRIER,
NM_CONFIG_KEYFILE_KEY_DEVICE_CHECK_CONNECTIVITY,
NM_CONFIG_KEYFILE_KEY_DEVICE_MANAGED,
NM_CONFIG_KEYFILE_KEY_DEVICE_SRIOV_NUM_VFS,
NM_CONFIG_KEYFILE_KEY_DEVICE_KEEP_CONFIGURATION,
@ -1046,6 +1048,10 @@ read_config(GKeyFile *keyfile,
/* internal groups cannot be set by user configuration. */
continue;
}
if (!g_key_file_has_group(keyfile, group))
nm_key_file_add_group(keyfile, group);
keys = g_key_file_get_keys(kf, group, &nkeys, NULL);
if (!keys)
continue;
@ -1639,6 +1645,12 @@ intern_config_read(const char *filename,
"");
}
if (!g_key_file_has_group(keyfile_intern, group)) {
nm_key_file_add_group(keyfile_intern, group);
if (is_intern)
has_intern = TRUE;
}
for (k = 0; keys[k]; k++) {
gs_free char *value_set = NULL;
const char *key = keys[k];
@ -1823,6 +1835,9 @@ intern_config_write(const char *filename,
}
}
if (!g_key_file_has_group(keyfile, group))
nm_key_file_add_group(keyfile, group);
for (k = 0; keys[k]; k++) {
const char *key = keys[k];
gs_free char *value_set = NULL;

View file

@ -77,6 +77,8 @@ struct _NMConnectivityCheckHandle {
ConConfig *con_config;
GCancellable *resolve_cancellable;
int resolve_ifindex;
GDBusConnection *dbus_connection;
CURLM *curl_mhandle;
CURL *curl_ehandle;
struct curl_slist *request_headers;
@ -953,6 +955,113 @@ systemd_resolved_resolve_cb(GObject *object, GAsyncResult *res, gpointer user_da
do_curl_request(cb_data, nm_str_buf_get_str(&strbuf_hosts));
}
static void
systemd_resolved_resolve(NMConnectivityCheckHandle *cb_data)
{
_LOG2D("start request to '%s' (try resolving '%s' using systemd-resolved with ifindex %d)",
cb_data->concheck.con_config->uri,
cb_data->concheck.con_config->host,
cb_data->concheck.resolve_ifindex);
g_dbus_connection_call(cb_data->concheck.dbus_connection,
"org.freedesktop.resolve1",
"/org/freedesktop/resolve1",
"org.freedesktop.resolve1.Manager",
"ResolveHostname",
g_variant_new("(isit)",
(gint32) cb_data->concheck.resolve_ifindex,
cb_data->concheck.con_config->host,
(gint32) cb_data->addr_family,
SD_RESOLVED_DNS),
G_VARIANT_TYPE("(a(iiay)st)"),
G_DBUS_CALL_FLAGS_NONE,
-1,
cb_data->concheck.resolve_cancellable,
systemd_resolved_resolve_cb,
cb_data);
}
static void
systemd_resolved_link_scopes_cb(GObject *object, GAsyncResult *res, gpointer user_data)
{
NMConnectivityCheckHandle *cb_data;
gs_unref_variant GVariant *result = NULL;
gs_unref_variant GVariant *value = NULL;
gs_free_error GError *error = NULL;
guint64 scope_mask = 0;
result = g_dbus_connection_call_finish(G_DBUS_CONNECTION(object), res, &error);
if (nm_utils_error_is_cancelled(error))
return;
cb_data = user_data;
if (!result) {
_LOG2D("unable to obtain systemd-resolved link ScopesMask for interface %d: %s",
cb_data->concheck.resolve_ifindex,
error->message);
cb_data->concheck.resolve_ifindex = 0;
systemd_resolved_resolve(cb_data);
return;
}
g_variant_get(result, "(v)", &value);
g_variant_get(value, "t", &scope_mask);
if (!(scope_mask & SD_RESOLVED_DNS)) {
/* there is no per-link DNS configured / active; query all available /
* system DNS resolvers instead of restricting the lookup to just this
* one, which would turn up no results. */
_LOG2D("no per-link DNS available (scope mask %" G_GUINT64_FORMAT
"); falling back to system-wide lookups",
scope_mask);
cb_data->concheck.resolve_ifindex = 0;
}
systemd_resolved_resolve(cb_data);
}
static void
systemd_resolved_get_link_cb(GObject *object, GAsyncResult *res, gpointer user_data)
{
NMConnectivityCheckHandle *cb_data;
gs_unref_variant GVariant *result = NULL;
gs_free char *link_path = NULL;
gs_free_error GError *error = NULL;
result = g_dbus_connection_call_finish(G_DBUS_CONNECTION(object), res, &error);
if (nm_utils_error_is_cancelled(error))
return;
cb_data = user_data;
if (!result) {
_LOG2D("unable to obtain systemd-resolved link D-Bus object for interface %d: %s",
cb_data->concheck.resolve_ifindex,
error->message);
cb_data->concheck.resolve_ifindex = 0;
systemd_resolved_resolve(cb_data);
return;
}
g_variant_get(result, "(o)", &link_path);
g_dbus_connection_call(cb_data->concheck.dbus_connection,
"org.freedesktop.resolve1",
link_path,
"org.freedesktop.DBus.Properties",
"Get",
g_variant_new("(ss)", "org.freedesktop.resolve1.Link", "ScopesMask"),
G_VARIANT_TYPE("(v)"),
G_DBUS_CALL_FLAGS_NONE,
-1,
cb_data->concheck.resolve_cancellable,
systemd_resolved_link_scopes_cb,
cb_data);
}
static NMConnectivityState
check_platform_config(NMConnectivity *self,
NMPlatform *platform,
@ -1067,6 +1176,7 @@ nm_connectivity_check_start(NMConnectivity *self,
}
cb_data->concheck.resolve_cancellable = g_cancellable_new();
cb_data->concheck.resolve_ifindex = ifindex;
/* note that we pick up support for systemd-resolved right away when we need it.
* We don't need to remember the setting, because we can (cheaply) check anew
@ -1089,10 +1199,8 @@ nm_connectivity_check_start(NMConnectivity *self,
has_systemd_resolved = !!nm_dns_manager_get_systemd_resolved(nm_dns_manager_get());
if (has_systemd_resolved) {
GDBusConnection *dbus_connection;
dbus_connection = NM_MAIN_DBUS_CONNECTION_GET;
if (!dbus_connection) {
cb_data->concheck.dbus_connection = NM_MAIN_DBUS_CONNECTION_GET;
if (!cb_data->concheck.dbus_connection) {
/* we have no D-Bus connection? That might happen in configure and quit mode.
*
* Anyway, something is very odd, just fail connectivity check. */
@ -1103,25 +1211,19 @@ nm_connectivity_check_start(NMConnectivity *self,
return cb_data;
}
g_dbus_connection_call(dbus_connection,
/* first check whether there has been a per-link DNS configured */
g_dbus_connection_call(cb_data->concheck.dbus_connection,
"org.freedesktop.resolve1",
"/org/freedesktop/resolve1",
"org.freedesktop.resolve1.Manager",
"ResolveHostname",
g_variant_new("(isit)",
0,
cb_data->concheck.con_config->host,
(gint32) cb_data->addr_family,
SD_RESOLVED_DNS),
G_VARIANT_TYPE("(a(iiay)st)"),
"GetLink",
g_variant_new("(i)", ifindex),
G_VARIANT_TYPE("(o)"),
G_DBUS_CALL_FLAGS_NONE,
-1,
cb_data->concheck.resolve_cancellable,
systemd_resolved_resolve_cb,
systemd_resolved_get_link_cb,
cb_data);
_LOG2D("start request to '%s' (try resolving '%s' using systemd-resolved)",
cb_data->concheck.con_config->uri,
cb_data->concheck.con_config->host);
return cb_data;
}

View file

@ -2865,6 +2865,7 @@ _host_id_read(guint8 **out_host_id, gsize *out_host_id_len)
0600,
NULL,
NULL,
NULL,
&error)) {
nm_log_warn(
LOGD_CORE,
@ -4642,13 +4643,13 @@ get_max_rate_vht_80_ss3(int mcs)
case 5:
return 702000000;
case 6:
return 0;
return 0; /* invalid */
case 7:
return 877500000;
case 8:
return 105300000;
return 1053000000;
case 9:
return 117000000;
return 1170000000;
}
return 0;
}
@ -4732,7 +4733,7 @@ get_max_rate_vht_160_ss3(int mcs)
case 8:
return 2106000000;
case 9:
return 0;
return 0; /* invalid */
}
return 0;
}
@ -5446,7 +5447,7 @@ again:
if ((g = g_atomic_int_get(&g_static)) == -1) {
gid_t g2;
g2 = geteuid();
g2 = getegid();
g = g2;
nm_assert(g == g2);
nm_assert(g >= 0);
@ -5504,6 +5505,155 @@ nm_utils_shorten_hostname(const char *hostname, char **shortened)
return TRUE;
}
/**
* nm_utils_connection_supported:
* @connection: the connection
* @error: on return, the reason why the connection in not supported
*
* Returns whether the given connection is supported by this version
* of NetworkManager.
*/
gboolean
nm_utils_connection_supported(NMConnection *connection, GError **error)
{
const char *type;
const char *feature = NULL;
g_return_val_if_fail(connection, FALSE);
g_return_val_if_fail(!error || !*error, FALSE);
type = nm_connection_get_connection_type(connection);
if (!WITH_TEAMDCTL) {
NMSettingConnection *s_con;
if (nm_streq0(type, NM_SETTING_TEAM_SETTING_NAME)) {
feature = "team";
goto out_disabled;
}
/* Match team ports */
if ((s_con = nm_connection_get_setting_connection(connection))
&& nm_streq0(nm_setting_connection_get_port_type(s_con),
NM_SETTING_TEAM_SETTING_NAME)) {
feature = "team";
goto out_disabled;
}
}
if (!WITH_OPENVSWITCH) {
if (NM_IN_STRSET(type,
NM_SETTING_OVS_BRIDGE_SETTING_NAME,
NM_SETTING_OVS_PORT_SETTING_NAME,
NM_SETTING_OVS_INTERFACE_SETTING_NAME)) {
feature = "Open vSwitch";
goto out_disabled;
}
/* Match OVS system interfaces */
if (nm_connection_get_setting_ovs_interface(connection)) {
feature = "Open vSwitch";
goto out_disabled;
}
}
if (!WITH_WIFI
&& NM_IN_STRSET(type,
NM_SETTING_WIRELESS_SETTING_NAME,
NM_SETTING_OLPC_MESH_SETTING_NAME,
NM_SETTING_WIFI_P2P_SETTING_NAME)) {
feature = "Wi-Fi";
goto out_disabled;
}
if (!WITH_WWAN
&& NM_IN_STRSET(type, NM_SETTING_GSM_SETTING_NAME, NM_SETTING_CDMA_SETTING_NAME)) {
feature = "WWAN";
goto out_disabled;
}
if (nm_streq0(type, NM_SETTING_WIMAX_SETTING_NAME)) {
feature = "WiMAX";
goto out_removed;
}
return TRUE;
out_disabled:
nm_assert(feature);
g_set_error(error,
NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_FEATURE_DISABLED,
"%s support is disabled in this build",
feature);
return FALSE;
out_removed:
nm_assert(feature);
g_set_error(error,
NM_SETTINGS_ERROR,
NM_SETTINGS_ERROR_FEATURE_REMOVED,
"%s is no longer supported",
feature);
return FALSE;
}
/*****************************************************************************/
/**
* nm_rate_limit_check():
* @rate_limit: the NMRateLimit instance
* @window_sec: the time window in seconds, between 1 and 864000 (ten days)
* @burst: the number of max allowed event occurrences in the given time
* window
*
* The function rate limits an event. Call it multiple times with the
* same @window_sec, and @burst values.
*
* Returns: TRUE if the event is allowed, FALSE if it is rate-limited
*/
gboolean
nm_rate_limit_check(NMRateLimit *rate_limit, gint32 window_sec, gint32 burst)
{
gint64 now;
gint64 old_ts_msec;
gint64 window_msec;
gint64 capacity;
gint64 elapsed;
nm_assert(window_sec >= 1 && window_sec <= 864000);
nm_assert(burst >= 1);
/* This implements a simple token bucket algorithm. For each millisecond,
* refill "burst" tokens. Thus, during a full time window we
* refill (window_msec * burst) tokens. Each event consumes @window_msec
* tokens. */
window_msec = (gint64) window_sec * NM_UTILS_MSEC_PER_SEC;
capacity = window_msec * (gint64) burst;
old_ts_msec = rate_limit->ts_msec;
now = nm_utils_get_monotonic_timestamp_msec();
rate_limit->ts_msec = now;
elapsed = now - old_ts_msec;
if (old_ts_msec == 0 || elapsed > window_msec) {
/* On the first call, or in case a whole window passed, (re)start with
* a full budget */
rate_limit->tokens = capacity;
} else {
rate_limit->tokens += elapsed * (gint64) burst;
rate_limit->tokens = NM_MIN(rate_limit->tokens, capacity);
}
/* Consume the tokens */
if (rate_limit->tokens >= window_msec) {
rate_limit->tokens -= window_msec;
return TRUE;
}
return FALSE;
}
const char *
nm_utils_get_connection_first_permissions_user(NMConnection *connection)
{

View file

@ -494,6 +494,19 @@ gid_t nm_utils_get_nm_gid(void);
/*****************************************************************************/
gboolean nm_utils_connection_supported(NMConnection *connection, GError **error);
/*****************************************************************************/
typedef struct {
gint64 ts_msec;
gint64 tokens;
} NMRateLimit;
gboolean nm_rate_limit_check(NMRateLimit *rate_limit, gint32 window_sec, gint32 burst);
/*****************************************************************************/
const char *nm_utils_get_connection_first_permissions_user(NMConnection *connection);
/*****************************************************************************/

View file

@ -120,6 +120,7 @@ struct _NML3ConfigData {
NMSettingConnectionMdns mdns;
NMSettingConnectionLlmnr llmnr;
NMSettingConnectionDnsOverTls dns_over_tls;
NMSettingConnectionDnssec dnssec;
NMUtilsIPv6IfaceId ip6_token;
NML3ConfigDatFlags flags;
@ -577,6 +578,16 @@ nm_l3_config_data_log(const NML3ConfigData *self,
NULL)));
}
if (self->dnssec != NM_SETTING_CONNECTION_DNSSEC_DEFAULT) {
gs_free char *s = NULL;
_L("dnssec: %s",
(s = _nm_utils_enum_to_str_full(nm_setting_connection_dnssec_get_type(),
self->dnssec,
" ",
NULL)));
}
if (self->mptcp_flags != NM_MPTCP_FLAGS_NONE) {
gs_free char *s = NULL;
@ -694,6 +705,7 @@ nm_l3_config_data_new(NMDedupMultiIndex *multi_idx, int ifindex, NMIPConfigSourc
.mdns = NM_SETTING_CONNECTION_MDNS_DEFAULT,
.llmnr = NM_SETTING_CONNECTION_LLMNR_DEFAULT,
.dns_over_tls = NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT,
.dnssec = NM_SETTING_CONNECTION_DNSSEC_DEFAULT,
.flags = NM_L3_CONFIG_DAT_FLAGS_NONE,
.metered = NM_TERNARY_DEFAULT,
.proxy_browser_only = NM_TERNARY_DEFAULT,
@ -1419,6 +1431,9 @@ _check_and_add_domain(GPtrArray **p_arr, const char *domain)
if (domain[0] == '.' || strstr(domain, ".."))
return FALSE;
if (!g_utf8_validate(domain, -1, NULL))
return FALSE;
len = strlen(domain);
if (domain[len - 1] == '.') {
copy = g_strndup(domain, len - 1);
@ -1764,6 +1779,26 @@ nm_l3_config_data_set_dns_over_tls(NML3ConfigData *self, NMSettingConnectionDnsO
return TRUE;
}
NMSettingConnectionDnssec
nm_l3_config_data_get_dnssec(const NML3ConfigData *self)
{
nm_assert(_NM_IS_L3_CONFIG_DATA(self, TRUE));
return self->dnssec;
}
gboolean
nm_l3_config_data_set_dnssec(NML3ConfigData *self, NMSettingConnectionDnssec dnssec)
{
nm_assert(_NM_IS_L3_CONFIG_DATA(self, FALSE));
if (self->dnssec == dnssec)
return FALSE;
self->dnssec = dnssec;
return TRUE;
}
NMIPRouteTableSyncMode
nm_l3_config_data_get_route_table_sync(const NML3ConfigData *self, int addr_family)
{
@ -2443,6 +2478,7 @@ nm_l3_config_data_cmp_full(const NML3ConfigData *a,
NM_CMP_DIRECT(a->mdns, b->mdns);
NM_CMP_DIRECT(a->llmnr, b->llmnr);
NM_CMP_DIRECT(a->dns_over_tls, b->dns_over_tls);
NM_CMP_DIRECT(a->dnssec, b->dnssec);
}
if (NM_FLAGS_HAS(flags, NM_L3_CONFIG_CMP_FLAGS_OTHER)) {
@ -3136,7 +3172,8 @@ void
nm_l3_config_data_hash_dns(const NML3ConfigData *l3cd,
GChecksum *sum,
int addr_family,
NMDnsIPConfigType dns_ip_config_type)
NMDnsIPConfigType dns_ip_config_type,
gboolean ignore_searches_and_options)
{
guint i;
int val;
@ -3175,16 +3212,18 @@ nm_l3_config_data_hash_dns(const NML3ConfigData *l3cd,
empty = FALSE;
}
searches = nm_l3_config_data_get_searches(l3cd, addr_family, &num_searches);
for (i = 0; i < num_searches; i++) {
g_checksum_update(sum, (const guint8 *) searches[i], strlen(searches[i]));
empty = FALSE;
}
if (!ignore_searches_and_options) {
searches = nm_l3_config_data_get_searches(l3cd, addr_family, &num_searches);
for (i = 0; i < num_searches; i++) {
g_checksum_update(sum, (const guint8 *) searches[i], strlen(searches[i]));
empty = FALSE;
}
options = nm_l3_config_data_get_dns_options(l3cd, addr_family, &num_options);
for (i = 0; i < num_options; i++) {
g_checksum_update(sum, (const guint8 *) options[i], strlen(options[i]));
empty = FALSE;
options = nm_l3_config_data_get_dns_options(l3cd, addr_family, &num_options);
for (i = 0; i < num_options; i++) {
g_checksum_update(sum, (const guint8 *) options[i], strlen(options[i]));
empty = FALSE;
}
}
val = nm_l3_config_data_get_mdns(l3cd);
@ -3205,6 +3244,12 @@ nm_l3_config_data_hash_dns(const NML3ConfigData *l3cd,
empty = FALSE;
}
val = nm_l3_config_data_get_dnssec(l3cd);
if (val != NM_SETTING_CONNECTION_DNSSEC_DEFAULT) {
g_checksum_update(sum, (const guint8 *) &val, sizeof(val));
empty = FALSE;
}
if (!empty) {
int prio = 0;
@ -3455,6 +3500,9 @@ nm_l3_config_data_merge(NML3ConfigData *self,
if (self->dns_over_tls == NM_SETTING_CONNECTION_DNS_OVER_TLS_DEFAULT)
self->dns_over_tls = src->dns_over_tls;
if (self->dnssec == NM_SETTING_CONNECTION_DNSSEC_DEFAULT)
self->dnssec = src->dnssec;
if (self->ip6_token.id == 0)
self->ip6_token.id = src->ip6_token.id;

View file

@ -458,6 +458,10 @@ NMSettingConnectionDnsOverTls nm_l3_config_data_get_dns_over_tls(const NML3Confi
gboolean nm_l3_config_data_set_dns_over_tls(NML3ConfigData *self,
NMSettingConnectionDnsOverTls dns_over_tls);
NMSettingConnectionDnssec nm_l3_config_data_get_dnssec(const NML3ConfigData *self);
gboolean nm_l3_config_data_set_dnssec(NML3ConfigData *self, NMSettingConnectionDnssec dnssec);
NMIPRouteTableSyncMode nm_l3_config_data_get_route_table_sync(const NML3ConfigData *self,
int addr_family);
@ -615,6 +619,7 @@ nmtst_l3_config_data_get_best_gateway(const NML3ConfigData *self, int addr_famil
void nm_l3_config_data_hash_dns(const NML3ConfigData *l3cd,
GChecksum *sum,
int addr_family,
NMDnsIPConfigType dns_ip_config_type);
NMDnsIPConfigType dns_ip_config_type,
gboolean ignore_searches_and_options);
#endif /* __NM_L3_CONFIG_DATA_H__ */

View file

@ -40,8 +40,7 @@ G_STATIC_ASSERT(NM_ACD_TIMEOUT_RFC5227_MSEC == N_ACD_TIMEOUT_RFC5227);
#define ACD_SUPPORTED_ETH_ALEN ETH_ALEN
#define ACD_ENSURE_RATELIMIT_MSEC ((guint32) 4000u)
#define ACD_WAIT_PROBING_EXTRA_TIME_MSEC ((guint32) (1000u + ACD_ENSURE_RATELIMIT_MSEC))
#define ACD_WAIT_PROBING_EXTRA_TIME2_MSEC ((guint32) 1000u)
#define ACD_WAIT_PROBING_EXTRA_TIME_MSEC ((guint32) (2000u + ACD_ENSURE_RATELIMIT_MSEC))
#define ACD_WAIT_TIME_PROBING_FULL_RESTART_MSEC ((guint32) 30000u)
#define ACD_WAIT_TIME_CONFLICT_RESTART_MSEC ((guint32) 120000u)
#define ACD_WAIT_TIME_ANNOUNCE_RESTART_MSEC ((guint32) 30000u)
@ -2294,7 +2293,7 @@ _l3_acd_data_timeout_schedule(AcdData *acd_data, gint64 timeout_msec)
* expect timeouts in certain states.
*
* That means, scheduling a timeout is only correct if we are in a certain
* state, which allows to handle timeouts. This assert checks for that to
* state, which allows one to handle timeouts. This assert checks for that to
* ensure we don't call a timeout in an unexpected state. */
nm_assert(NM_IN_SET(acd_data->info.state,
NM_L3_ACD_ADDR_STATE_PROBING,
@ -2740,9 +2739,8 @@ handle_init:
nm_utils_get_monotonic_timestamp_msec_cached(p_now_msec);
if (acd_data->info.state == NM_L3_ACD_ADDR_STATE_PROBING) {
if ((*p_now_msec) > acd_data->probing_timestamp_msec
+ ACD_WAIT_PROBING_EXTRA_TIME_MSEC
+ ACD_WAIT_PROBING_EXTRA_TIME2_MSEC) {
if ((*p_now_msec)
> acd_data->probing_timestamp_msec + ACD_WAIT_PROBING_EXTRA_TIME_MSEC) {
/* hm. We failed to create a new probe too long. Something is really wrong
* internally, but let's ignore the issue and assume the address is good. What
* else would we do? Assume the address is USED? */
@ -2751,9 +2749,8 @@ handle_init:
goto handle_start_defending;
}
acd_data->probing_timestamp_msec = (*p_now_msec);
acd_data->probing_timeout_msec = acd_timeout_msec;
log_reason = "retry probing on timeout";
acd_data->probing_timeout_msec = acd_timeout_msec;
log_reason = "retry probing on timeout";
goto handle_start_probing;
}
@ -2949,7 +2946,7 @@ handle_init:
nm_utils_get_monotonic_timestamp_msec_cached(p_now_msec);
if (acd_data->probing_timestamp_msec + acd_data->probing_timeout_msec
+ ACD_WAIT_PROBING_EXTRA_TIME_MSEC + ACD_WAIT_PROBING_EXTRA_TIME2_MSEC
+ ACD_WAIT_PROBING_EXTRA_TIME_MSEC
>= (*p_now_msec)) {
/* The probing already started quite a while ago. We ignore the link event
* and let the probe come to it's natural end. */
@ -3050,7 +3047,7 @@ handle_start_probing:
if (!acd_data->nacd_probe) {
_LOGT_acd(acd_data,
"probing currently %snot possible (timeout %u msec; %s, %s)",
orig_state == NM_L3_ACD_ADDR_STATE_INIT ? "" : " still",
orig_state == NM_L3_ACD_ADDR_STATE_INIT ? "" : "still ",
acd_data->probing_timeout_msec,
failure_reason,
log_reason);
@ -3059,9 +3056,10 @@ handle_start_probing:
}
_LOGT_acd(acd_data,
"%sstart probing (timeout %u msec, %s)",
"%sstart probing (timeout %u msec, ebpf %s; %s)",
orig_state == NM_L3_ACD_ADDR_STATE_INIT ? "" : "re",
acd_data->probing_timeout_msec,
n_acd_has_bpf(self->priv.p->nacd) ? "enabled" : "disabled",
log_reason);
return;
}
@ -3156,10 +3154,11 @@ handle_start_defending:
}
_LOGT_acd(acd_data,
"start announcing (defend=%s) (probe created)",
"start announcing (defend=%s) (probe created with ebpf %s)",
_l3_acd_defend_type_to_string(acd_data->acd_defend_type_current,
sbuf256,
sizeof(sbuf256)));
sizeof(sbuf256)),
n_acd_has_bpf(self->priv.p->nacd) ? "enabled" : "disabled");
acd_data->acd_defend_type_is_active = FALSE;
acd_data->nacd_probe = probe;
return;
@ -3990,7 +3989,7 @@ _l3cfg_routed_dns_apply(NML3Cfg *self, const NML3ConfigData *l3cd)
NMDnsServer dns;
int r;
if (!nm_dns_uri_parse(addr_family, nameservers[i], &dns))
if (!nm_dns_uri_parse(addr_family, nameservers[i], &dns, NULL))
continue;
/* Find the gateway to the DNS over the current interface. When
@ -5055,8 +5054,8 @@ _l3_commit_mptcp_af(NML3Cfg *self,
(NM_FLAGS_HAS(mptcp_flags, NM_MPTCP_FLAGS_SIGNAL) ? MPTCP_PM_ADDR_FLAG_SIGNAL : 0)
| (NM_FLAGS_HAS(mptcp_flags, NM_MPTCP_FLAGS_SUBFLOW) ? MPTCP_PM_ADDR_FLAG_SUBFLOW : 0)
| (NM_FLAGS_HAS(mptcp_flags, NM_MPTCP_FLAGS_BACKUP) ? MPTCP_PM_ADDR_FLAG_BACKUP : 0)
| (NM_FLAGS_HAS(mptcp_flags, NM_MPTCP_FLAGS_FULLMESH) ? MPTCP_PM_ADDR_FLAG_FULLMESH
: 0);
| (NM_FLAGS_HAS(mptcp_flags, NM_MPTCP_FLAGS_FULLMESH) ? MPTCP_PM_ADDR_FLAG_FULLMESH : 0)
| (NM_FLAGS_HAS(mptcp_flags, NM_MPTCP_FLAGS_LAMINAR) ? MPTCP_PM_ADDR_FLAG_LAMINAR : 0);
NMPlatformMptcpAddr a = {
.ifindex = self->priv.ifindex,
.id = 0,

Some files were not shown because too many files have changed in this diff Show more