Commit graph

33789 commits

Author SHA1 Message Date
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
Filip Pokryvka
5749633729 release: bump version to 1.51.90 (1.52-rc1) 2025-02-12 13:27:22 +01:00
Filip Pokryvka
bb8bb65216 NEWS: update 2025-02-12 12:56:23 +01:00
Beniamino Galvani
fbd87bf961 merge: branch 'bg/autoconnect-ports-ovs'
Fix autoconnect-ports for OVS interfaces

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2131
2025-02-12 08:54:02 +00:00
Beniamino Galvani
774badb151 core: prevent the activation of unavailable devices
When autoconnecting ports of a controller, we look for all candidate
(device,connection) tuples through the following call trace:

 -> autoconnect_ports()
   -> find_ports()
     -> nm_manager_get_best_device_for_connection()
       -> nm_device_check_connection_available()
         -> _nm_device_check_connection_available()

The last function checks that a specific device is available to be
activated with the given connection. For virtual devices, it only
checks that the device is compatible with the connection based on the
device type and characteristics, without considering any live network
information.

For OVS interfaces, this doesn't work as expected. During startup, NM
performs a cleanup of the ovsdb to remove entries that were previously
added by NM. When the cleanup is terminated, NMOvsdb sets the "ready"
flag and is ready to start the activation of new OVS interfaces. With
the current mechanism, it is possible that a OVS-interface connection
gets activated via the autoconnect-ports mechanism without checking
the "ready" flag.

Fix that by also checking that the device is available for activation.
2025-02-12 09:53:06 +01:00
Beniamino Galvani
6c1eb99d32 core: cleanup nm_manager_get_best_device_for_connection()
Rename "unavailable_devices" to "exclude_devices", as the
"unavailable" term has a specific, different meaning in NetworkManager
(i.e. the device is in the UNAVAILABLE state). Also, use
nm_g_hash_table_contains() when needed.
2025-02-12 09:51:01 +01:00
Jason A. Donenfeld
c627bbea4c nm-random-utils: always generate good random bytes and prioritize getrandom support
The current mess of code seems like a hodgepodge of complex ideas,
partially copied from systemd, but then subtly different, and it's a
mess. Let's simplify this drastically.

First, assume that getrandom() is always available. If the kernel is too
old, we have an unoptimized slowpath for still supporting ancient
kernels, a path that should be removed at some point. If getrandom()
isn't available and the fallback path doesn't work, the system has much
larger problems, so just crash. This should basically never happen.
getrandom() and having randomness available in general is a critical
system API that should be expected to be available on any functioning
system.

Second, assume that the rng is initialized, so that asking for random
numbers should never block. This is virtually always true on modern
kernels. On ancient kernels, it usually becomes true. But, more
importantly, this is not the responsibility of various daemons, even
ones that run at boot. Instead, this is something for the kernel and/or
init to ensure.

Putting these together, we adopt new behavior:

- First, try getrandom(..., ..., 0). The 0 flags field means that this
  call will only return good random bytes, not insecure ones.

- If this fails for some reason that isn't ENOSYS, crash.

- If this fails due to ENOSYS, poll on /dev/random until 1 byte is
  available, suggesting that subsequent reads from the rng will almost
  have good random bytes. If this fails, crash. Then, read from
  /dev/urandom. If this fails, crash.

We don't bother caching when getrandom() returns ENOSYS. We don't apply
any other fancy optimizations to the slow fallback path. We keep that as
barebones and minimal as we can. It works. It's for ancient kernels. It
should be removed soon. It's not worth spending cycles over. Instead,
the goal is to eventually reduce all of this down to a simple boring
call to getrandom(..., ..., 0).

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2127
2025-02-11 10:04:26 +01:00
Georg Müller
2fd34e1dec libnm-core: fix error message if address-data parsing fails
The code checks for presence of 'address' and 'prefix', so these fields
should be part of the error message.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2118
2025-02-11 10:01:31 +01:00
Lubomir Rintel
36bc62309b merge: branch 'lr/jenkins-custom-fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2130
2025-02-10 11:31:57 +01:00
Lubomir Rintel
5eefd2d59c Revert "cloud-setup: parse OCI metadata related to VLAN config"
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2129

This reverts commit cfd7dd86c9.
2025-02-07 11:03:13 +01:00
Vladimír Beneš
f7db7c78e9 release: bump version to 1.51.7 (development) 2025-02-07 10:18:15 +01:00