Commit graph

34549 commits

Author SHA1 Message Date
Beniamino Galvani
4e3371964c gitlab-ci: disable CLAT if required libraries are missing
Old Alpine and Debian release don't have the required libraries,
disable CLAT on them.

Fixes: dd3758dd80 ('contrib: Add libbpf and libxdp to dependencies')
2026-03-12 09:45:03 +00:00
Beniamino Galvani
62997ac8c0 merge: branch 'bg/warn-unreachable-gateways'
Warn about directly unreachable gateways

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2360
2026-03-12 07:46:09 +00:00
Beniamino Galvani
589286df78 NEWS: mention the warnings for unreachable gateways 2026-03-11 15:12:15 +01:00
Beniamino Galvani
8b9a702e1d core: emit warning for unreachable gateways 2026-03-11 15:12:15 +01:00
Beniamino Galvani
907508f4bf nmtui: emit warning for unreachable gateways 2026-03-11 15:12:15 +01:00
Beniamino Galvani
ec5f98e7a8 nmcli: emit warning for unreachable gateways 2026-03-11 15:12:15 +01:00
Beniamino Galvani
2b4b8d7e7e libnm-core: add function to get a warning message for unreachable gateways
We are going to print the same warning message in different places
(the daemon, nmcli, nmtui). Add a function to return the message. Note
that the message needs to be translated in clients but not in the
daemon logs.
2026-03-11 15:12:15 +01:00
Beniamino Galvani
f42e422b69 libnm-core: add function to detect directly-unreachable gateways
nm_connection_get_unreachable_gateways() is a non-public function,
available in the daemon and clients, which detects gateways in the
static configuration that are not directly reachable.

Unreachable gateways are often the consequence of user mistakes; we
want to catch them early. In the following commits, warnings will be
emitted when a connection is created/modified/activated and has
unreachable gateways.
2026-03-11 15:12:15 +01:00
Rahul Rajesh
22f4e74942 merge: branch 'rr/fix-avc-error'
core: delay D-Bus type initialization for --print-config

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2376
2026-03-10 12:36:29 +00:00
Till Maas
57bc396c12 core: delay D-Bus type initialization for --print-config
The --print-config option should only read and print the configuration
without initializing any D-Bus infrastructure. However, g_type_ensure()
calls for D-Bus types were happening before the --print-config check,
causing GLib/GIO to set up D-Bus infrastructure and create cache
directories (~/.cache/bus or /root/.cache) unnecessarily.

Move the g_type_ensure() calls to after the --print-config (and
--version) early exits, so they only run when NetworkManager actually
needs to start normally and use D-Bus.

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

Assisted-by: Claude Code claude-sonnet-4-5@20250929
Signed-off-by: Till Maas <opensource@till.name>
2026-03-06 14:30:23 -05:00
Íñigo Huguet
0e2b679afb merge: branch 'ih/perm_unmanaged'
add API to manage/unmanage devices in a persistent way

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2358
2026-03-06 10:23:58 +00:00
Íñigo Huguet
b6bd9cee87 NEWS: update 2026-03-06 11:21:58 +01:00
Íñigo Huguet
2fbaca1cbc 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-06 11:21:57 +01:00
Íñigo Huguet
1252f8dc7e core: config: add unit tests for the new get/set_device_managed 2026-03-06 11:21:56 +01:00
Íñigo Huguet
7ee50b687a 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-06 11:21:55 +01:00
Íñigo Huguet
d2f98a1669 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-06 11:21:53 +01:00
Íñigo Huguet
7c8f343f2c 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-06 11:21:52 +01:00
Íñigo Huguet
b9725dab73 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-06 11:21:51 +01:00
Íñigo Huguet
f346fcf977 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-06 11:21:50 +01:00
Íñigo Huguet
ec1522fa8c 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-06 11:21:48 +01:00
Íñigo Huguet
0a1503f052 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-06 11:21:48 +01:00
Íñigo Huguet
47c1b04f9e 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-06 11:21:47 +01:00
Íñigo Huguet
9ff530c322 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-06 11:21:47 +01:00
Íñigo Huguet
121034d655 merge: branch 'ih/nmcli_field_ports'
nmcli: add BRIDGE.PORTS, TEAM.PORTS and GENERAL.CONTROLLER-PATH fields. Replace SLAVE for PORT in `c show`

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2369
2026-03-05 07:08:54 +00:00
Íñigo Huguet
cdd38f7cdf nmcli: replace SLAVE for PORT, still accepting SLAVE as alias
With `nmcli -f SLAVE` the PORT column will be shown. In this case we
don't duplicate the field because it's typically shown in columns and
having duplicated columns is more annoying than a duplicated row.
2026-03-05 07:08:14 +00:00
Íñigo Huguet
c6b6c7164b libnmc: allow to define an alias to match fields to show 2026-03-05 07:08:14 +00:00
Íñigo Huguet
ff1d435096 nmcli: add BRIDGE.PORTS, TEAM.PORTS and GENERAL.CONTROLLER-PATH fields
They show the same than the old BRIDGE/TEAM.SLAVES and GENERAL.MASTER-PATH.
We missed this when we did the changes in favour of conscious language.
Instead of replacing them, we add a new field that will show the same
value with the new name. This way we avoid breaking users doing
`nmcli -f BRIDGE.SLAVES` or `nmcli ... | grep SLAVES`.
2026-03-05 07:08:14 +00:00
Beniamino Galvani
1a2fec62f0 merge: branch 'bg/drop-veth-peer-ioctl'
platform: drop ioctl fallback for finding veth's peer

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2354
2026-03-04 17:27:08 +00:00
Beniamino Galvani
fddda02825 platform: drop ioctl fallback for finding veth's peer
The peer ifindex of a veth interface is available via netlink since
kernel 4.1 released in 2015. Drop the code that falls back to ioctl.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1881
2026-03-04 16:51:57 +00:00
Beniamino Galvani
2d30b71dd4 merge: branch 'bg/dhcp-routes'
dhcp: ignore the Router option when there are Classless Static Routes

Closes #834

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2364
2026-03-04 16:51:33 +00:00
Beniamino Galvani
7651ef0386 dhcp: ignore the Router option when there are Classless Static Routes
RFC 3442 says:

   If the DHCP server returns both a Classless Static Routes option and
   a Router option, the DHCP client MUST ignore the Router option.

Currently the internal client is ignoring the Router option only if
the Classless Static Routes option doesn't include a default route,
which is different from what is recommended in the RFC. Fix the behavior.

Fixes: 6adade6f21 ('dhcp: add nettools dhcp4 client')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/834
2026-03-04 15:26:11 +00:00
Íñigo Huguet
8236c1c16a merge: branch 'lr/mtu-clarity'
device: do not set MTU twice in stage3

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2231
2026-03-04 11:15:19 +00:00
Lubomir Rintel
818cf77cb5 device: do not set MTU twice in stage3
The pair of _commit_mtu() calls in activate_stage3_ip_config() are very
heavily commented, but it is still not clear why would there be two of
them.

Remove one, and try to clarify the situation in an updated comment.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2231
2026-03-04 11:15:01 +00:00
Jan Vaclav
98256be220 merge: branch 'jv/onlink'
platform: introduce per-nexthop onlink attribute

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2368
2026-03-03 10:10:49 +00:00
Jan Vaclav
d564a0c3f9 platform: track onlink flag per-nexthop for IPv4 routes
In kernel, the onlink flag (RTNH_F_ONLINK) is associated with each
nexthop (rtnh_flags) rather than the route as a whole. NM previously
stored it only per-route in NMPlatformIPRoute.r_rtm_flags, which meant
that two nexthops only differing with the onlink flag were combined
as one entry in the platform cache.

Fix this by tracking the onlink flag per-nexthop.

Resolves: https://issues.redhat.com/browse/NMT-1486
2026-03-02 10:57:56 +00: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