Commit Graph

34021 Commits

Author SHA1 Message Date
Beniamino Galvani
37c0e0860e NEWS: update 2025-07-01 14:26:44 +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
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
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
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
Filip Pokryvka
e26e965134 release: bump version to 1.55.1 (development) 2025-06-20 09:19:23 +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
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