Commit graph

34533 commits

Author SHA1 Message Date
Íñigo Huguet
0132e6c13c NEWS: update 2026-03-04 14:33:05 +01:00
Íñigo Huguet
2b6191eb63 checkpoint: rollback devices' "permanently managed" configuration
If a device's "managed" configuration is changed persistently (stored to
NM-intern), it needs to be undone in a rollback.
2026-03-04 14:32:58 +01:00
Íñigo Huguet
73e1ef539c core: config: add unit tests for the new get/set_device_managed 2026-03-04 08:08:33 +01:00
Íñigo Huguet
04d73297e3 fixup! nmcli: wait for device set async operation to finish 2026-03-03 14:37:41 +01:00
Íñigo Huguet
54e76ec901 nmcli: wait for device set async operation to finish
We need to wait for it to finish so we can show error messages, if any.

Also, if we don't do it, sometimes the `d set eth0 managed ...`
operation fails with the following message in the daemon's log: "Unable
to determine UID of the request". This is because the client's process
is terminated before the daemon can check the permissions, as it needs
to check the uid and gid from the client's process.
2026-03-03 14:37:39 +01:00
Íñigo Huguet
d5f6c35867 nmcli: add managed --permanent yes/no/up/down/reset
Allow to manage or unmanage a device persisting across reboots.
If --permanent is not specified, only the runtime managed state is
changed, preserving the previous behavior. The --permanent-only
option allows to edit only the persistent value, without touching
the runtime value.

Also add the values up/down. Up means managed=yes and set device's
administrative state UP. Down means managed=no and admin state DOWN.

Add the value 'reset' too. It reverts managed runtime status to default
behaviour. When used with `--permanent` flag, the persisted managed
settings is cleared.

Co-authored-by: Rahul Rajesh <rajeshrah22@gmail.com>
2026-03-03 14:37:35 +01:00
Íñigo Huguet
d9f587a97b core: device: autoselect device match criteria in SetManaged()
Devices like veth without a permanent MAC address cannot be matched by
MAC. If using the BY_MAC flag in SetManaged(), the changes are not
effective for such kind of devices.

Add a BY_NAME flag, in addition to the BY_MAC one. If the client sets
one of them, it means to force this mode of matching. If none is
selected, the daemon will choose how to match, preferring matching by
MAC when possible, and by ifname when not possible.
2026-03-03 14:37:33 +01:00
Íñigo Huguet
f0380dffc9 fixup! core: device: allow to change the admin state of the device in SetManaged() 2026-03-03 14:37:30 +01:00
Íñigo Huguet
bd72fdd720 core: device: allow to change the admin state of the device in SetManaged()
Control it with a new NM_DEVICE_MANAGED_SET_ADMIN_STATE flag.
This flag will make that, at the same time that the device is moved to
managed/unmanaged, it's admin state is set to up/down. Many users want
to have a way to have their devices in a DOWN admin state when they are
not using them. Because of the complex activation process, NM wants to
have its devices in UP state all the time. However, it is not a problem
to have it DOWN if we are not managing it.
2026-03-03 14:37:28 +01:00
Íñigo Huguet
a03d4f35cd fixup! core: device: allow to reset the managed property 2026-03-03 14:37:26 +01:00
Íñigo Huguet
a0733b936e core: device: allow to reset the managed property
Previous commits added the capability to persist to disk the value of
'managed' received via the D-Bus API. Users might need to clear the
previous content, thus reseting it to its default.

Although this is specially useful for the PERMANENT flag, we need to be
consistent and reset the runtime state too.
2026-03-03 14:37:24 +01:00
Íñigo Huguet
4cdc759cac fixup! core: device: implement storing to disk for Device.SetManaged() 2026-03-03 14:37:23 +01:00
Íñigo Huguet
0d78e29289 core: device: implement storing to disk for Device.SetManaged()
If the NM_DEVICE_MANAGED_FLAGS_PERMANENT flag is used, the value will be
stored to disk, to the NetworkManager-intern.conf file, in a [device-*]
section.

To modify the runtime value, the NM_DEVICE_MANAGED_FLAGS_RUNTIME must be
passed. This allows to control independently whether to modify only one
or both.
2026-03-03 14:37:02 +01:00
Íñigo Huguet
a74d13bf96 fixup! core: config: allow to store 'managed' configs to NM-intern 2026-03-03 11:41:56 +01:00
Íñigo Huguet
3a0c79b8e3 core: config: allow to store 'managed' configs to NM-intern
To support setting devices as managed or unmanaged via D-Bus API in a
permanent way, we need a way to store this configuration on disk. Before
this commit, only config files manually edited allowed it. Following
commits will make use of the new functions to store [device-*] sections
into NetworkManager-intern.conf depending on D-Bus method invocations.
2026-03-03 11:41:56 +01:00
Íñigo Huguet
febb5355fc fixup! core: config-data: don't ignore [.intern.device/connection] sections 2026-03-03 11:41:55 +01:00
Íñigo Huguet
0f32784962 core: config-data: don't ignore [.intern.device/connection] sections
Now it is possible to have [.intern.device-*] sections in
NetworkManager-intern.conf. Take them into account when parsing the
configuration keyfiles.
2026-03-03 11:41:54 +01:00
Íñigo Huguet
8f73178063 fixup! dbus: device: add SetManaged method 2026-03-03 11:41:50 +01:00
Íñigo Huguet
e2b622042b dbus: device: add SetManaged method
The 'Managed' property only sets the managed state in runtime, but it is
not possible to persist it to disk. Add a SetManaged method that will be
able to persist it to disk. In this commit, it just modify the runtime
state, so it actually only does the same than setting the property.
Storing to disk will be added in next commits.
2026-03-03 10:37:23 +01:00
Beniamino Galvani
a924826e2c merge: branch 'rr/fix-create-and-realize'
device: fix vxlan create_and_realize

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2363
2026-02-27 16:33:42 +00:00
Rahul Rajesh
04f7ca5029 device: fix vxlan create_and_realize
Assert that remote and local will be valid in this function since it
will be verified in verify function in connection profile.
2026-02-27 16:26:16 +00:00
Beniamino Galvani
de6d9930b9 gitlab: improve the merge request template
Mention the commit subject format.
2026-02-27 11:59:16 +01:00
Beniamino Galvani
30ca65ab88 merge: branch 'kk-l10n-add'
Add Kazakh translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2359
2026-02-27 09:41:00 +00:00
Baurzhan Muftakhidinov
bf80a9019e Add Kazakh translation 2026-02-27 10:02:13 +01:00
Beniamino Galvani
6b37d612fd merge: branch 'nmtui-tilde'
nmtui: allow enter tilde in search domains

Closes #1862

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2356
2026-02-27 08:58:02 +00:00
Vladislav Tsisyk
dbeb7fa0f6 nmtui: accept tilde in search domains
Closes #1862
2026-02-27 08:57:20 +00:00
Beniamino Galvani
b7d9625ae1 merge: branch 'lr/systemd-unit-lockdown'
data/NetworkManager.service: restrict the unit some more

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2062
2026-02-27 08:46:04 +00:00
Lubomir Rintel
cb51c4475a data/NetworkManager.service: restrict the unit some more
This adds some low-hanging food to improve our score with "systemd-analyze
security" by one point:

Before:
  → Overall exposure level for NetworkManager.service: 7.8 EXPOSED 🙁

After:
  → Overall exposure level for NetworkManager.service: 6.8 MEDIUM 😐

Nothing particularly impactful here: we still got DAC_OVERRIDE, we still
can insert loadable modules (as opposed to relying on autoload) and
read user home directories. But there's a slight chance this may save
our butts one day, who knows.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2062
2026-02-27 08:44:10 +00:00
Beniamino Galvani
756e612858 merge: branch 'fix-vpn-search-domains'
vpn: set search domains

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2340
2026-02-26 17:00:08 +00:00
François HORTA
03a3a449f6 vpn: set search domains
dns-search parameters set on VPN connections should be merged with
domains received through the VPN (which may be empty if the connection
sets ignore-auto-dns).

This is currently not the case because domains received by the VPN
connection are only added through nm_l3_config_data_add_domain.

If dns-search is unset, this behaves correctly because the structure
built in _mgr_configs_data_construct in src/core/dns/nm-dns-manager.c
correctly uses the domains from nm_l3_config_data_get_domains.

However if dns-search is set, nm_l3_config_data_get_searches is no
longer empty and it takes precedence because of the "n_searches > 0"
condition.
2026-02-26 16:40:59 +00:00
Beniamino Galvani
926795f11a merge: branch 'bulgarian'
Updated bulgarian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2350
2026-02-26 15:12:51 +00:00
twlvnn
e4ca177be2 Updated bulgarian translation 2026-02-26 15:01:49 +00:00
Beniamino Galvani
20f975abe3 merge: branch 'bg/secret-permissions'
Fix the handling of permissions for connection secrets

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2367
2026-02-25 08:24:10 +00:00
Beniamino Galvani
024360bffa settings: fix check on existing system secrets
The previous check was based only on the presence of a non-NULL
"existing_secrets" GVariant. That GVariant is created via:

  nm_connection_to_dbus(nm_settings_connection_get_connection(self),
                        NM_CONNECTION_SERIALIZE_WITH_SECRETS_SYSTEM_OWNED)

The function returns a GVariant containing a first-level dictionary
for each setting, even for those that doesn't contain any secrets. As
a result, the check was requiring the system.modify permission even if
there weren't any cached secrets to send to the agent.

Fix the check to actually check for the presence of any secrets in the
cached dictionary. Some connection types have a third-level
dictionary that can be empty, for example VPNs have vpn.secrets.
2026-02-25 09:05:04 +01:00
Beniamino Galvani
db0825a110 settings: accept not-saved secrets from agents without modify-system
The "modify.system" polkit permission allows a user to modify settings
for connection profiles that belong to all users.

For this reason, when an agent returns system secrets (i.e. secrets
that are going to be stored to disk), NetworkManager checks that the
agent has the modify.system permission.

If a secret has the AGENT_OWNED flag, it's stored in the agent
itself. If the secret has the NOT_SAVED flag, it will be asked to
users at the beginning of every connection attempt.

In both those cases the profile is not modified and there is no need
for the modify.system permission. Fix the check to also consider the
NOT_SAVED flag.
2026-02-24 08:46:32 +01:00
Beniamino Galvani
eff8330b57 libnm-core: add missing flags check in .to_dbus_function()
Properties that define a .to_dbus_function() as a D-Bus override, need
to return early if the flags only ask to serialize secrets.

Fixes: 7fb23b0a62 ('libnm: add NMIPRoutingRule API')
2026-02-24 08:46:32 +01:00
Beniamino Galvani
128b49fe21 merge: branch 'rr/geneve-support'
geneve: add support for GENEVE tunnels

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2352
2026-02-18 12:43:47 +00:00
Rahul Rajesh
2e2b4946ea NEWS: add support for GENEVE interface
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2352

Resolves: https://issues.redhat.com/browse/RHEL-122042
2026-02-17 16:02:45 -05:00
Rahul Rajesh
0bfb8fa89d geneve: added GENEVE device support
Support device type geneve in libnm and nmcli.
2026-02-17 15:21:03 -05:00
Rahul Rajesh
2aaf88375e geneve: add connection profile settings
Added support for the following properties in connection profile:
id (VNI), remote IPv4/IPv6, ttl, tos, df, destination port.

See IP-LINK(8) manual page with command `man 8 ip-link` for more details
on the properties. See also previous commit for nm supported attributes.

id and remote are mandatory attributes:
```
$ nmcli connection add type geneve save no
Error: 'id' argument is required.
$ nmcli connection add type geneve id 42 save no
Error: 'remote' argument is required.
```
2026-02-17 15:21:03 -05:00
Rahul Rajesh
29c8bbe21a platform: add support for GENEVE tunnels
GENEVE (Generic Network Virtualization Encapsulation) is a network
tunneling protocol that provides a flexible encapsulation format for
overlay networks. It uses UDP as the transport protocol and supports
variable-length metadata in the tunnel header.

This patch adds GENEVE tunnel to NM's platform layer:

- Add platform API functions (nm_platform_link_geneve_add,
  nm_platform_link_get_lnk_geneve)

- Netlink message parsing for the following attributes:
  * IFLA_GENEVE_ID - VNI (Virtual Network Identifier)
  IPv4 and IPv6 remote
  * IFLA_GENEVE_REMOTE
  * IFLA_GENEVE_REMOTE6
  TTL, TOS, and DF flags
  * IFLA_GENEVE_TTL
  * IFLA_GENEVE_TOS
  * IFLA_GENEVE_DF
  UDP destination port
  * IFLA_GENEVE_PORT

- Add test cases for GENEVE tunnel creation and detection with two test
  modes covering IPv4 and IPv6.

The implementation tries to follow the same patterns as other tunnel
types (GRE, VXLAN, etc.) and integrates with the existing platform
abstraction layer.
2026-02-17 15:21:03 -05:00
Rahul Rajesh
ad78bd8570 platform: expand nmp object type flags to guint64
To allow for more than 32 NMP_OBJECT_* types.
2026-02-17 15:21:03 -05:00
Beniamino Galvani
54a4b42c05 merge: branch 'docs/get_secrets_fix'
docs: GetSecrets doesn't accept empty string

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2355
2026-02-17 10:35:30 +00:00
Mattia Dal Ben
8c93d0bdff introspection: fix documentation for GetSecrets 2026-02-17 09:01:20 +00:00
Beniamino Galvani
4fcebeaec0 merge: branch 'man-nmcli-checkpoint'
man: fix sentence in nmcli manual page

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2351
2026-02-17 09:00:40 +00:00
Federico Ton
40f19ad674 man: fix sentence in nmcli manual page
A not very clear sentence in the description of the `nmcli device checkpoint` command has been changed.
2026-02-16 18:57:52 +01:00
Vladimír Beneš
f70b37357a release: bump version to 1.57.3 (development) 2026-02-13 13:30:02 +01:00
Vladimír Beneš
30a5416a54 tmp 2026-02-13 13:23:55 +01:00
Vladimír Beneš
56b51b98fb release: bump version to 1.56.0 2026-02-12 23:14:41 +01:00
Jan Vaclav
cf52d3f52b 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/

(cherry picked from commit d40e88fd02)
2026-02-12 20:27:20 +01:00