Commit graph

34150 commits

Author SHA1 Message Date
Beniamino Galvani
fcf9b60cc2 build: remove autotools leftovers 2025-09-08 10:46:44 +00:00
Íñigo Huguet
7c0510ba0b merge: branch 'patch-1'
Replace sl.po (translated another 400 strings).

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2267
2025-09-08 10:46:04 +00:00
filmsi
26ac482f1c Replace sl.po (translated another 400 strings). 2025-09-08 10:45:56 +00:00
Beniamino Galvani
6c84a19eb2 merge: branch 'use-dynsym-for-exports'
build: use .dynsym for selecting symbols to export

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2262
2025-09-03 12:15:00 +00:00
Mateusz Mikuła
e5884cfb18 build: use .dynsym for selecting symbols to export
Nm uses .symtab by default which is less reliable for this use case.

Previously this would fail if user enabled stripping or used linker
that doesn't add undefined symbols to .symtab, like here:
https://github.com/davidlattimore/wild/issues/819#issuecomment-3215079862
2025-09-03 07:14:53 +00:00
Beniamino Galvani
7242c478a1 manager: unrealize device again after failure
If the device was realized in _internal_activate_device() and the
activation failed to start, unrealize the device again so that it
doesn't stay around.

Fixes-test: @ovs_delete_connecting_interface

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2263
2025-09-02 10:16:58 +02:00
Íñigo Huguet
d39179bee4 merge: branch 'ih/fix-wifi-dispose'
wifi: don't recheck  auto-activate on disposal

Closes #1791

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2259
2025-08-27 06:37:48 +00:00
Íñigo Huguet
3904135150 wifi: don't recheck auto-activate on disposal
During disposal we're calling to remove_all_aps that in turns schedules
an auto-activate recheck. As the device is removed, this triggers an
assertion when trying to do the recheck.

Fix that by not scheduling the recheck.

Example of backtrace that this commits fix:
  0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
  1  0xf746e270 in __pthread_kill_implementation (threadid=<optimized out>, signo=6, no_tid=<optimized out>) at pthread_kill.c:43
  2  0xf743fbc6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
  3  0xf7431614 in __GI_abort () at abort.c:79
  4  0xf775afea in g_assertion_message (domain=domain@entry=0x209a9f "nm", file=file@entry=0x1f7d59 "../NetworkManager-1.43.7/src/core/nm-policy.c", line=line@entry=1665,
     func=func@entry=0x1f94d9 <__func__.6> "nm_policy_device_recheck_auto_activate_schedule",
     message=message@entry=0x1d3e950 "assertion failed: (g_signal_handler_find(device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, NM_POLICY_GET_PRIVATE(self)) != 0)")
     at ../glib-2.72.3/glib/gtestutils.c:3253
  5  0xf775b05e in g_assertion_message_expr (domain=0x209a9f "nm", file=0x1f7d59 "../NetworkManager-1.43.7/src/core/nm-policy.c", line=1665,
     func=0x1f94d9 <__func__.6> "nm_policy_device_recheck_auto_activate_schedule",
     expr=0x1f8afc "g_signal_handler_find(device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, NM_POLICY_GET_PRIVATE(self)) != 0") at ../glib-2.72.3/glib/gtestutils.c:3279
  6  0x0005f27a in nm_policy_device_recheck_auto_activate_schedule (self=0x1d3e950, device=0x209a9f) at ../NetworkManager-1.43.7/src/core/nm-policy.c:1679
  7  0x000548ae in nm_manager_device_recheck_auto_activate_schedule (self=<optimized out>, device=<optimized out>) at ../NetworkManager-1.43.7/src/core/nm-manager.c:3113
  8  0x00070622 in nm_device_recheck_auto_activate_schedule (self=<optimized out>) at ../NetworkManager-1.43.7/src/core/devices/nm-device.c:9249
  9  0xf693aa8c in ap_add_remove (self=self@entry=0x1ceb0b0, is_adding=0, ap=<optimized out>, recheck_available_connections=0)
     at ../NetworkManager-1.43.7/src/core/devices/wifi/nm-device-wifi.c:846
  10 0xf693bcda in remove_all_aps (self=self@entry=0x1ceb0b0) at ../NetworkManager-1.43.7/src/core/devices/wifi/nm-device-wifi.c:863
  11 0xf693f83c in dispose (object=0x1ceb0b0) at ../NetworkManager-1.43.7/src/core/devices/wifi/nm-device-wifi.c:3809
  12 0xf7806e72 in g_object_unref (_object=<optimized out>) at ../glib-2.72.3/gobject/gobject.c:3636
  13 g_object_unref (_object=0x1ceb0b0) at ../glib-2.72.3/gobject/gobject.c:3553
  14 0x000f7fa4 in _nm_dbus_object_clear_and_unexport (location=location@entry=0xffa50644) at ../NetworkManager-1.43.7/src/core/nm-dbus-object.c:203
  15 0x000576e4 in remove_device (self=self@entry=0x1c9c900, device=<optimized out>, quitting=quitting@entry=1) at ../NetworkManager-1.43.7/src/core/nm-manager.c:2289
  16 0x0005a864 in nm_manager_stop (self=self@entry=0x1c9c900) at ../NetworkManager-1.43.7/src/core/nm-manager.c:7784
  17 0x00023438 in main (argc=<optimized out>, argv=<optimized out>) at ../NetworkManager-1.43.7/src/core/main.c:530

Fixes: 96f40dcdcd ('wifi/ap: explicitly unexport AP and refactor add/remove AP')
Fixes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1791
2025-08-27 06:37:33 +00:00
Beniamino Galvani
0b03614b68 device: ensure that sw devices are unrealized after connection deletion
When a software device becomes deactivated, we check whether it can
be unrealized (= deleted in kernel), by calling function
delete_on_deactivate_check_and_schedule().

The function returns without doing anything if there is a new
activation enqueued on the device (priv->queued_act_request), because
in that case the device will be reused for the next activation.

This commit fixes a problem seen in NMCI test
@ovs_delete_connecting_interface: sometimes the device is not
unrealized after deleting the connection. That happens because if the
queued activation fails, we never try again to unrealize the device.

Fix that by calling delete_on_deactivate_check_and_schedule() when
there is a failure starting the queued activation.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2258
2025-08-26 20:51:32 +02:00
Beniamino Galvani
8b26cb35ee device: explicitly handle unrealized devices in is_available()
Unrealized software devices are always available for activation,
hardware devices never.

In nm_manager_get_best_device_for_activation() we call
nm_device_is_available() on candidate devices. Without this fix, any
unrealized software device would be not considered ready for
activation, which is wrong.

A software device can override the default implementation of
is_available(). For example NMDeviceOvsInterface does that and only
checks the OVSDB is ready.

Fixes: ba86c208e0 ('Revert "core: prevent the activation of unavailable OVS interfaces only"')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2253
2025-08-26 20:39:18 +02:00
Íñigo Huguet
96be0cf049 merge: branch 'ih/domain-search-sep'
dns: ensure that no wrong separators are used for DNS search domains

Closes #1740

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2196
2025-08-26 09:00:18 +00:00
Íñigo Huguet
b0b72dd2f1 dns: don't break existing configs with wrong separators in dns-search
The previous commit will raise an error if wrong list
separators are being used in an nmconnection file for dns-search to
avoid that they are all considered a single string.

However, existing users might have wrong values of dns-search that
currently are not preventing the connection of being activated. To avoid
that a NetworkManager update breaks existing configs, potentially even
cutting connectivity with remote machines, accept wrong separators in
keyfiles but emitting a warning.

Fixes: 919156552ede ('dns: ensure that no wrong separators are used for DNS search domains')
2025-08-26 08:59:37 +00:00
Íñigo Huguet
3266203bf1 dns: ensure that no wrong separators are used for DNS search domains
If wrong separators are used in they keyfile, like commas, the whole
line is considered as a single domain string, like "a.org,b.org".
Obviously this is invalid.

Ideally we should validate that the string is a valid domain, but this
gets quite complex if we want to support unicode characters, which are
valid for many top domains. For now, validate at least that no wrong
separators have been used.

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1740
2025-08-26 08:59:37 +00:00
Beniamino Galvani
21bbe24fee merge: branch 'nbft-parser-2'
nm-initrd-generator: Add NBFT tests

Closes #1756

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2256
2025-08-26 08:01:09 +00:00
Tomas Bzatek
dce149352d nm-initrd-generator: add NBFT parser tests
This adds simple unit tests for most common NBFT deployments.
Sample data were mostly taken from the upstream libnvme repository.
2025-08-26 07:45:53 +00:00
Tomas Bzatek
592a4f077b nm-initrd-generator: fix a conn_name leak 2025-08-26 07:45:53 +00:00
Tomas Bzatek
6304d51440 nm-initrd-generator: rework NBFT HFI DHCP detection
There are several flags specified in the NVMe Boot Specification
that may indicate DHCP was used to acquire information during the
pre-OS phase. This commit considers these additional sources,
based on actual NBFT table contents from different systems.

Although we've seen slight variations in firmware implementations
regarding the HFI IP Origin values when DHCP was configured, the
new set of rules still align with expectations.
2025-08-26 07:45:53 +00:00
Beniamino Galvani
0c1fba5c95 wireguard: don't add peer routes if they duplicate prefix routes
With this configuration:

  [Interface]
  ...
  Address = 172.16.110.116/28,172.16.111.21/28

  [Peer]
  ...
  AllowedIPs = 172.16.110.112/28

  [Peer]
  ...
  AllowedIPs = 172.16.111.16/28

NetworkManager currently creates the following routes

  (1) 172.16.110.112/28 dev wg0 proto static scope link metric 50 <-- peer route
  (2) 172.16.110.112/28 dev wg0 proto kernel scope link src 172.16.110.116 metric 50 <-- prefix route
  (3) 172.16.111.16/28 dev wg0 proto static scope link metric 50 <-- peer route
  (4) 172.16.111.16/28 dev wg0 proto kernel scope link src 172.16.111.21 metric 50 <-- prefix route

If we try to reach a host in the second peer subnet, route (4)
matches. Route (4) doesn't specify a source IP and so the kernel will
use the first IP set on the interface (172.16.110.116), which is the
wrong one.

  # ip route get 172.16.111.17
  172.16.111.17 dev wg0 src 172.16.110.116 uid 0

To fix this problem, if the AllowedIP subnet is already reachable on
the interface via the prefix route of a static IP address, we should
skip adding the peer route.

wg-quick does something similar here:

  https://git.zx2c4.com/wireguard-tools/tree/src/wg-quick/linux.bash?h=v1.0.20250521#n177

The condition in wg-quick is a bit different because it checks that no
duplicate route exists on the interface. We can't do exactly the same
because in NMDeviceWireGuard we don't have visibility on all the
platform routes.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1790
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2254
2025-08-25 16:49:16 +02:00
Íñigo Huguet
933ddab90f merge: branch 'ih/close-parenthesis'
libnmc: fix typo of missing close parenthesis

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2249
2025-08-25 13:35:33 +00:00
Íñigo Huguet
f5c5bcc99d libnmc: fix typo of missing close parenthesis 2025-08-25 13:35:33 +00:00
Íñigo Huguet
7b4d0ef9f2 merge: branch 'ih/release-vpn-gnome'
doc: update the process to release a VPN plugin

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2252
2025-08-25 13:34:54 +00:00
Íñigo Huguet
79ffe55686 doc: update the process to release a VPN plugin 2025-08-25 13:34:54 +00:00
Beniamino Galvani
94d7dd9b11 rpm: change system_ca_path
/etc/pki/tls/cert.pem was a symlink to
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem since Fedora 19 and
it is being removed in Fedora 43.

See https://fedoraproject.org/wiki/Changes/droppingOfCertPemFile

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2257
https://bugzilla.redhat.com/show_bug.cgi?id=2380436
2025-08-25 15:19:47 +02:00
Jan Vaclav
29390b053d merge: branch 'jv/reapply-vfs'
device: add support for reapplying the `sriov.vfs` property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2255
2025-08-21 08:32:57 +00:00
Jan Vaclav
bbe0e9d8c2 NEWS: update 2025-08-20 09:58:52 +02:00
Jan Vaclav
4ba3ffee67 device: add support for reapplying the sriov.vfs property
Adds support for reapplying the `sriov.vfs` property. Note this
does not include `num_vfs`, as the configuration needs to be reset
and reconfigured from scratch in that case.

Previously, if an existing VF is modified (e.g. if we change the `trust`
flag), we reset all VF configurations, and started from scratch. But in
some cases, this is unnecessarily disruptive.

Resolves: https://issues.redhat.com/browse/RHEL-95844
2025-08-20 09:58:52 +02:00
Jan Vaclav
588a69cd1b device: extract sriov platform vf generation to separate function 2025-08-20 09:58:52 +02:00
Beniamino Galvani
11da867072 merge: branch 'bg/dns-server-valid'
libnm: add nm_dns_server_validate()

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2251
2025-08-18 12:04:03 +00:00
Beniamino Galvani
9f76e11a75 libnm: add nm_dns_server_validate()
Add a new public symbol nm_dns_server_validate() that clients can use
to validate a single DNS server before adding it to the connection.
2025-08-14 11:22:41 +02:00
Beniamino Galvani
d62c25ef2f dns: return error from nm_dns_uri_parse()
Return a GError from nm_dns_uri_parse() to indicate why the URI could
not be parsed. This is useful for logging and user reporting.
2025-08-14 09:40:26 +02:00
Beniamino Galvani
e1a7d5ac06 device: don't generate an assumed connection for ports on wake
After resuming from suspend, devices with wake-on-lan enabled are
temporarily set as unmanaged, and then managed again. At the beginning
of this process, an active device goes from state ACTIVATED to
UNMANAGED and is deconfigured via
"nm_device_cleanup(cleanup_type=CLEANUP_TYPE_DECONFIGURE)".

If the device is attached to a controller, the cleanup doesn't detach
it. Later when the device is managed again, NetworkManager tries to
create an assumed connection. Normally, this would fail because we
detect that the device is not configured. However, if there is a
controller-port relationship, the assumed connection generation
succeeds and the persistent connection doesn't go up.

As this is wrong, prevent the generation of the assumed connection by
detaching the port during a cleanup.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1766
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2242
2025-08-13 13:43:24 +02:00
Íñigo Huguet
600c5452bf po: fix command that should not be translated
The message contains a literal command that should not be translated,
but it was. Fix it.

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1799
2025-08-12 10:52:29 +02:00
Filip Pokryvka
7562b0e5f9 release: bump version to 1.55.3 (development) 2025-08-01 16:00:58 +02:00
Filip Pokryvka
37dbdd3199 release: bump version to 1.54.0 2025-08-01 15:31:24 +02:00
Íñigo Huguet
4baacfd09d NEWS: update 2025-08-01 14:23:53 +02:00
Beniamino Galvani
a386912ddb platform: fix compilation without LTO
Fix the following error seen when running the build_clean.sh script
with LTO disabled:

  In file included from ../src/libnm-glib-aux/nm-default-glib.h:66,
                   from ../src/libnm-glib-aux/nm-default-glib-i18n-prog.h:13,
                   from ../src/core/nm-default-daemon.h:11,
                   from ../src/core/platform/tests/test-link.c:6:
  In function ‘_nm_auto_freev’,
      inlined from ‘test_link_get_bridge_fdb’ at ../src/core/platform/tests/test-link.c:2732:33:
  ../src/libnm-glib-aux/nm-macros-internal.h:166:8: error: ‘addrs’ may be used uninitialized [-Werror=maybe-uninitialized]
    166 |     if (*p) {
        |        ^
  ../src/core/platform/tests/test-link.c: In function ‘test_link_get_bridge_fdb’:
  ../src/core/platform/tests/test-link.c:2732:33: note: ‘addrs’ was declared here
   2732 |     nm_auto_freev NMEtherAddr **addrs;
        |                                 ^~~~~
  cc1: all warnings being treated as errors

Fixes: 16ef33d380 ('bond-slb: fix memory leak')
(cherry picked from commit b4a22ad2a9)
2025-07-31 15:59:35 +02:00
Beniamino Galvani
1194528b27 nmcli: fix format
Fixes: a9b66e254c ('nmcli: fix compile error')
(cherry picked from commit eff8471de4)
2025-07-31 15:59:34 +02:00
Beniamino Galvani
84c7533760 platform: fix GError free function
Fixes: dd7810c473 ('platform: destroy VFs before changing the eswitch mode')
(cherry picked from commit 394f6281ea)
2025-07-31 15:59:33 +02:00
Beniamino Galvani
43058de07a device: fix signal emission on port detach/release
The "notify::controller" signal must be emitted on the port, not on
the controller.

Fixes: 1f05526ed7 ('core: drop NMDevice master and introduce controller')
(cherry picked from commit 012f1cbfac)
2025-07-31 15:59:32 +02:00
Beniamino Galvani
ca7d42cd7a l3cfg: don't reset the ACD probe timestamp during timer events
acd_data->probing_timestamp_msec indicates when the probing
started. It is used in different places to calculate the timeout for
certain operations. In particular, it is used to detect that the probe
creation took too long when handling the ACD_STATE_CHANGE_MODE_TIMEOUT
event.

If we reset this timestamp at every timer event, we'll never hit the
probe creation timeout. Therefore, the l3cfg will keep trying forever
to create the probe.
See: https://lists.freedesktop.org/archives/networkmanager/2025-July/000418.html

Fix this by not updating the timestamp during a timeout event.

Fixes: a09f9cc616 ('l3cfg: ensure the probing timeout is initialized on probe start')
(cherry picked from commit 407d753a5a)
2025-07-31 15:59:32 +02:00
Beniamino Galvani
2e963061cb l3cfg: fix logging message
Fix spacing in:

 acd[192.168.122.42, probing]: probing currently  stillnot possible
                                                 ^^^^^^^^^

Fixes: b8f9d7b5dd
(cherry picked from commit 74cf2a2bd8)
2025-07-31 15:59:31 +02:00
Beniamino Galvani
8ae10b4148 ndisc: fix logic to limit the number of addresses
Fixes: c2c8c67d8c ('ndisc: rate limit number of accepted RA data to track')
(cherry picked from commit eb7917a387)
2025-07-31 15:59:31 +02:00
Beniamino Galvani
f78dca964f libnm-core: validate the ipvlan mode
The setting must reject unknown ipvlan modes.

Fixes: d238ff487b ('ipvlan: add support to IPVLAN interface')
(cherry picked from commit fdb8f07c44)
2025-07-31 15:59:31 +02:00
Beniamino Galvani
6b01ae3f15 libnm-core: fix p-key validation for Infiniband connections
verify() is setting an error without returning FALSE to make the
validation fail. When the parent is set, the device is a Infiniband
partition and it must have a p-key != -1.

Fixes: d595f7843e ('libnm: add libnm/libnm-core (part 1)')
(cherry picked from commit f4f1ecc7ea)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
976c5dbb5f libnm-core: fix documentation for NMSettingMatch functions
Fixes: 3a8e46f2a5 ('settings: add match for proc cmdline')
(cherry picked from commit 104cafdd44)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
e56bc740d0 core: fix nm_utils_get_nm_gid()
Fixes: 31dbcb81fe ('core: make nm_utils_get_nm_[ug]id() thread safe')
(cherry picked from commit b58a37acfe)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
12e033368f core: fix Wi-Fi data rate tables
Fixes: f2b0092b5b ('wifi: parse BSS IEs for 80211n and 80211ac data rates')
(cherry picked from commit fa80896ee7)
2025-07-31 15:59:30 +02:00
Beniamino Galvani
f4c5ded09b dhcp: fix parsing of the search list option
The DHCP search list option (119) can use the "message compression"
algorithm specified in RFC 1035 section 4.1.4 to reduce the size of
the message in presence of subdomains that appear multiple times.

When using the compression a label starts with:

    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
    | 1  1|                OFFSET                   |
    +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

where the offset points to a previous domain.

Previously, the parsing code was taking the lower 6 bits of the first
byte, shifting them left 16 bits, and adding the next byte. Instead,
the shift should be of 8 bits.

The effect of this bug was that when the offset was greater than 255,
it was incorrectly parsed as a number larger than the message size,
and the parsing failed.

Note that while a single DHCP option can be at most 255 bytes, a DHCP
message can contain multiple instances of the same option. The
receiver must concatenate all the occurrences according to RFC 3396
and parse the resulting buffer.

Fixes: 6adade6f21 ('dhcp: add nettools dhcp4 client')
(cherry picked from commit a9d7abbc50)
2025-07-31 15:59:29 +02:00
Beniamino Galvani
ce40c72812 dhcp: fix typo in tcp_keepalive_interval option name
Fixes: eed205bff3 ('dhcp/internal: move dhcp options management to shared dhcp codebase')
(cherry picked from commit d017dc67b4)
2025-07-31 15:59:29 +02:00
Beniamino Galvani
85edac5d7c bond-slb: fix memory leak
If sendto() fails, the function returns and the remaining entries are
not deallocated. Use nm_auto_freev instead to free the array and the
pointer it contains.

Add a test to check that nm_auto_freev does the right thing on the
value returned by nm_linux_platform_get_bridge_fdb().

Fixes: 3f2f922dd9 ('bonding: send ARP announcement on bonding-slb link/carrier down')
(cherry picked from commit 16ef33d380)
2025-07-31 15:59:29 +02:00