Commit graph

33977 commits

Author SHA1 Message Date
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
Íñ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