Commit graph

34251 commits

Author SHA1 Message Date
Beniamino Galvani
99bf25db3c core: fix rate-limit test failures
It's possible that the first timeout gets delayed; therefore the
interval between the first and the second callback can be less than
one second, and the budget doesn't refill completely.

Schedule the second timeout from the first callback to guarantee that
at least one second passes between the callbacks.

Fixes: ff0c4346fc ('core: add rate-limiting helper')
2025-11-18 13:54:03 +01:00
Íñigo Huguet
239b0fbbc9 release: bump version to 1.57.0 (development) 2025-11-17 16:42:05 +01:00
Íñigo Huguet
29d523391a release: bump version to 1.55.90 (1.56-rc1) 2025-11-17 16:35:34 +01:00
Beniamino Galvani
f4bf54ca93 merge: branch 'bg/ndisc-ratelimit-warns'
ndisc: rate limit messages about invalid RAs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2294
2025-11-12 13:12:25 +00:00
Beniamino Galvani
22631d557a ndisc: rate limit messages about invalid RAs
Sending and receiving RA is repeated periodically. Don't spam logs
with the same message again and again. Rate limit the message to 6
every 12 hours per type and per ndisc instance.
2025-11-12 14:05:30 +01:00
Beniamino Galvani
ff0c4346fc core: add rate-limiting helper
It can be used to perform an action like logging a message with
simple rate limiting.
2025-11-12 11:48:59 +01:00
Jan Vaclav
5f85b55f7f NEWS: update
Fixes: 04ddd72ce9 ('merge: branch 'jv/import-nacd'')
2025-10-30 12:34:16 +01:00
Beniamino Galvani
461c9edfb4 merge: branch 'main'
Correctly apply some connection properties to vpn connections

Closes #1109

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2279
2025-10-27 09:46:41 +00:00
Robin Ebert
306f9c490b vpn: Use nm_device_create_l3_config_data_from_connection if possible
Using nm_device_create_l3_config_data_from_connection in favor of
nm_l3_config_data_new_from_connection allows the connection
properties: connection.mdns, connection.llmnr,
connection.dns-over-tls, connection.dnssec, connection.mptcp-flags,
and ipv6.ip6-privacy to be read from the vpn's connection settings
allowing them to be applied to vpn connections.
2025-10-27 10:31:16 +01:00
Robin Ebert
441e77a44c core: Make nm_device_create_l3_config_data_from_connection behave as expected
Currently nm_device_create_l3_config_data_from_connection uses the
connection applied to the given device for some properties.  Altough
this currently works since all users of
nm_device_create_l3_config_data_from_connection provide the applied
connection as parameter, it behaves unexpectedly when another
connection is given.
2025-10-27 09:58:07 +01:00
Íñigo Huguet
caf156b2ac merge: branch 'ih/fix-ci-pages'
ci: fix pages job

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2303
2025-10-24 11:58:18 +00:00
Íñigo Huguet
ed43e4b602 ci: fix pages job
Fix the rule that triggers this job so it is run each time that a commit
is pushed/merged to main. The incorrect rule was doing that it only ran
when the *source* branch (or a MR) was called "main". Therefore, it was
(almost) never running.

Fixes: 69efb4660c ('CI: periodically clean image's registry')
2025-10-24 12:48:20 +02:00
Íñigo Huguet
384dd7d5f2 merge: branch 'ih/forwarding'
core: ip forwarding: improve performance setting IPv4 forwarding for method=shared and forwarding=auto

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2201
2025-10-24 05:27:36 +00:00
Íñigo Huguet
e06aaba1ca core: mark as managed-type=removed when unrealize
This is needed to ensure that the right CleanupType is chosen when
calling to nm_device_state_changed() a bit later. With this change
CLEANUP_TYPE_REMOVED will be used instead of CLEANUP_TYPE_DECONFIGURE,
which is wrong because the device has already disappeared.
2025-10-24 05:27:18 +00:00
Íñigo Huguet
32cbf4c629 ip: shared: stop using the global forwarding
As we introduced the ipv4.forwarding property in a8a2e6d727 ('ip-config:
Support configuring per-device IPv4 sysctl forwarding option'), we must
not enable or disable the global forwarding setting in the kernel, as it
affects to all the devices, maybe forcing them to behave in a way
different to what the user requested in ipv4.forwarding.

Instead, we need to selectively enable or disable the per-device forwarding
settings. Specifically, only devices activated with ipv4.forwarding=auto
must have their forwarding enabled or disabled depending on shared
connections. Devices with yes/no must not be affected by shared connections.

Also, devices with ipv4.forwarding=auto must get the proper forwarding value
on activation, but also change it when shared connections appear or
disappear dynamically. Use the new sharing-ipv4-change signal from
nm_manager to achieve it.

Fixes: a8a2e6d727 ('ip-config: Support configuring per-device IPv4 sysctl forwarding option')
2025-10-24 05:27:18 +00:00
Íñigo Huguet
8faa33b9d4 manager: add sharing-ipv4-changed signal
This signal notifies about the "sharing state", that's it, when there
is at least one shared connection active or not. Each device informs
to nm_manager when a shared connection is activated or deactivated
and nm_manager emits this signal when the first shared connection is
activated or the last one is deactivated.

For now we're only interested in IPv4 forwarding as it's the only one
that we need to track from nm_device (in following commits).

Fixes: a8a2e6d727 ('ip-config: Support configuring per-device IPv4 sysctl forwarding option')
2025-10-24 05:27:18 +00:00
Íñigo Huguet
d58d0a793e ip: restore IP forwarding on device deconfiguration
With the ipv4.forwarding property we may modify the forwarding sysctl of
the device on activation. In next commits, we will also modify it if the
connection is shared, instead of modifying the global forwarding.

Restore the forwarding value to the default one when the device is
deconfigured for any reason.

Fixes: a8a2e6d727 ('ip-config: Support configuring per-device IPv4 sysctl forwarding option')
2025-10-24 05:27:18 +00:00
Íñigo Huguet
f2a2e49d07 Revert "policy: refresh IPv4 forwarding after connection activation and disconnection"
This reverts commit 2ad5fbf025.

It is actually a partial revert. The changes to documentation don't need
to be reverted.

Fixes: 2ad5fbf025 ('policy: refresh IPv4 forwarding after connection activation and disconnection')
2025-10-24 05:27:18 +00:00
Beniamino Galvani
b4e8edbc8a merge: branch 'pskmismatch-signal-handlers'
core: add handlers for PskMismatch signal

Closes #904

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2287
2025-10-23 14:38:43 +00:00
Mitchell Augustin
6dd07a80e5 core: add handlers for PskMismatch signal
Trigger a new PSK request to the user when the PskMismatch
signal is received from wpa_supplicant.

Closes #904
2025-10-23 14:36:54 +00:00
Jan Vaclav
04ddd72ce9 merge: branch 'jv/import-nacd'
n-acd: detect eBPF capability at runtime

Closes #1049

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2300
2025-10-23 13:33:30 +00:00
Íñigo Huguet
58f46a6d11 merge: branch 'localhost'
core: nm-dns-dnsmasq: listen on ipv6 localhost too

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1504
2025-10-23 05:42:34 +00:00
Jan Vaclav
427137d6da service: add CAP_BPF capability to NetworkManager
Since we are now always building n-acd with eBPF, and
are able to detect eBPF support at runtime, we can
reflect this in the unit as well.

Add CAP_BPF to CapabilityBoundingSet, so that NM can
request to create a BPF map when setting up n-acd.
2025-10-22 21:49:56 +02:00
Jan Vaclav
b1614ffb90 l3cfg: add info about n-acd eBPF state to log messages 2025-10-22 21:49:56 +02:00
Jan Vaclav
8d33aaa5b6 build: drop "ebpf" configuration for n-acd compilation
Since we now check whether the user's machine supports
eBPF at runtime, we can drop all of this build machinery.
2025-10-22 21:48:39 +02:00
Jan Vaclav
191ebb439a n-dhcp4: re-import git-subtree for 'src/n-dhcp4'
git subtree pull --prefix src/n-dhcp4 git@github.com:nettools/n-dhcp4.git master --squash
2025-10-22 20:09:41 +02:00
Jan Vaclav
2f35c94628 Squashed 'src/n-dhcp4/' changes from 2707213e3e..0d4dcc9bb4
0d4dcc9bb4 n-dhcp4: introduce n_dhcp4_c_connection_clear_client_ip() helper
433c57ab2e n-dhcp4: Do not set ciaddr in DISCOVER state.
feacc2cccd n-dhcp4: change the default DSCP value to 0
b64e2c62e8 n-dhcp4: support setting the DSCP value
6cfa9d84d0 n-dhcp4: set xid of the DHCP header for RELEASE and DECLINE message

git-subtree-dir: src/n-dhcp4
git-subtree-split: 0d4dcc9bb45d5a63d53a787289ad79823343e624
2025-10-22 20:09:23 +02:00
Jan Vaclav
3a769bca67 n-acd: re-import git-subtree for 'src/n-acd'
git subtree pull --prefix src/n-acd git@github.com:nettools/n-acd.git master --squash
2025-10-22 20:09:16 +02:00
Jan Vaclav
0530af60b3 Squashed 'src/n-acd/' changes from a600afc870..6ac6f7e105
6ac6f7e105 n-acd: runtime eBPF support detection

git-subtree-dir: src/n-acd
git-subtree-split: 6ac6f7e105c06e0c352b78b5a136f87fcb5c7432
2025-10-22 20:09:16 +02:00
Jiri Slaby (SUSE)
a0482a4e35 core: nm-dns-dnsmasq: listen on ipv6 localhost too
Trying to resolve hosts using localhost errors out for ipv6 attempts:
  $ host www.seznam.cz localhost
  ;; communications error to ::1#53: connection refused
  ;; communications error to ::1#53: connection refused
  Using domain server:
  Name: localhost
  Address: 127.0.0.1#53
  Aliases:

  www.seznam.cz has address 77.75.77.222
  www.seznam.cz has address 77.75.79.222
  ;; communications error to ::1#53: connection refused
  ;; communications error to ::1#53: connection refused
  www.seznam.cz has IPv6 address 2a02:598:a::79:222
  www.seznam.cz has IPv6 address 2a02:598:2::1222
  ;; communications error to ::1#53: connection refused
  ;; communications error to ::1#53: connection refused

It's because on some distros (like openSUSE), localhost is defined both
as 127.0.0.1 and ::1.

So listen on ::1 too. This makes ipv4-switchoff easier.
/etc/resolv.conf should likely be updated to contain ::1 eventually too
(see update_dns()).

Fixes https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1188
2025-10-22 15:42:57 +02:00
Beniamino Galvani
0e121f5658 merge: branch 'bg/dns-no-stub'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2298
2025-10-22 10:01:46 +02:00
Beniamino Galvani
2d438ebef8 dns: specify a temporary file name when writing no-stub-resolv.conf
Using g_file_set_contents() makes it impossible to write a proper
SELinux policy because the function creates a file with a random
suffix, and SELinux file transitions can't match on wildcards.

Use a fixed temporary file name. In this case it's fine because
/run/NetworkManager is only writable by root and NetworkManager is the
only process writing into it.
2025-10-22 09:56:39 +02:00
Beniamino Galvani
c312390932 libnm-glib-aux: add temp name argument to nm_utils_file_set_contents()
In some cases it's useful to specify the name of the temporary file to
be used.
2025-10-22 09:56:39 +02:00
Íñigo Huguet
d06fd85e57 merge: branch 'ih/ovsdb-update-log'
ovs: print clearer logs of the ovsdb "update" event

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2297
2025-10-22 06:07:32 +00:00
Íñigo Huguet
2a63c33712 ovs: print clearer logs of the ovsdb "update" event
These lines says things like "changed a bridge", what seems to mean that
NM is doing the change. Actually, these logs indicate changes that NM is
being notified of, and they may even be external changes.

- Add the "monitor:" prefix to show that it's something that NM is
  monitoring, not doing.
- Say "bridge changed" instead of "changed a bridge", which sounds an
  action that we're doing.
- Print the bridge/port/iface name first, instead of the uuid-like key which
  is not useful for a quick look by a human.
- Print `connection=conn-uuid` instead of just `conn-uuid`, as it's not
  obvious that the uuid refers to the connection.

Before:
  ovsdb: obj[bridge:8c975244-cb0a-4add-8901-c398dcbc27d6]: changed a bridge: br-int, b1ef934d...

After:
  ovsdb: monitor: br-int: bridge changed: obj[bridge:8c975244-cb0a-4add-8901-c398dcbc27d6], connection=b1ef934d...
2025-10-22 06:07:25 +00:00
Beniamino Galvani
ce26d85ad1 merge: branch 'bg/reject-unsupported-conns'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2299
2025-10-21 15:34:19 +02:00
Beniamino Galvani
1e81aaa153 settings: document some data structures 2025-10-21 15:31:58 +02:00
Beniamino Galvani
c1baf09bf9 settings: ignore unsupported connections when they are loaded
In addition to rejecting new connections added via D-Bus when they are
unsupported, also ignore the existing on-disk ones.
2025-10-21 15:31:58 +02:00
Beniamino Galvani
247000deed core: reject new connections if the feature is disabled or removed
If a feature like Wi-Fi, OVS, team, etc. is disabled or no longer
supported, it is better to report an error when the connection is
added via nmcli than accepting the connection and complaining later
about a "missing plugin"; there is no plugin and the connection will
never be able to activate.

Example errors now:
  # nmcli connection add type team
  Error: Failed to add 'team-nm-team' connection: team support is disabled in this build

  # nmcli connection add type gsm
  Error: Failed to add 'gsm' connection: WWAN support is disabled in this build

  # nmcli connection add type wimax nsp 00:99:88:77:66:55
  Error: Failed to add 'wimax' connection: WiMAX is no longer supported

Note that we don't touch libnm-core (the part defining the settings
and properties), as that defines the API of NetworkManager. The API
should not change according to compile flags.
2025-10-21 15:31:58 +02:00
Íñigo Huguet
e5ae988603 merge: branch 'fix-autoreconnection'
Fix: unblock autoreconnect when a previously failed connection is now successful

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2295
2025-10-21 09:43:05 +00:00
Antoine Lassagne
03791e8b2d Fix: unblock autoreconnect when a previously failed connection is now successful 2025-10-21 09:39:52 +00:00
Beniamino Galvani
965aa81027 device: set bridge in supplicant for 802.1X ethernet and macsec
When authenticating via 802.1X, the supplicant must be made aware of
the bridge the interface is attached to. This was already done for
wifi in commit ae31b4bf4e ('wifi: set the BridgeIfname supplicant
property when needed'). When setting the BridgeIfname property, the
supplicant opens an additional socket to listen on the bridge, to
ensure that all incoming EAPOL packets are received.

Without this patch, the initial authentication usually works because
it is started during stage2 (prepare), when the device is not yet
attached to the bridge, but then the re-authentication fails.

Note: I could reproduce the problem only when the bridge is configured
with bridge.group-forward-mask 8.

Resolves: https://issues.redhat.com/browse/RHEL-121153
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2301
2025-10-21 11:26:08 +02:00
Jan Vaclav
86b67233bf merge: branch 'jv/hsr-interlink'
libnm: introduce `hsr.interlink` property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2285
2025-10-13 10:42:51 +00:00
Beniamino Galvani
a148232789 merge: branch 'dnssec'
Add support for systemd-resolved's DNSSEC option

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2278
2025-10-13 10:10:34 +00:00
Robin Ebert
2bc895c0e9
NEWS: add new connection.dnssec feature to NEWS 2025-10-13 11:58:11 +02:00
Robin Ebert
c6a6801b1e
ifcfg-rh: throw error if connection.dnssec is used 2025-10-13 11:57:54 +02:00
Robin Ebert
46306c1be0
cli: add support for connection.dnssec 2025-10-13 11:57:53 +02:00
Robin Ebert
1dcd63ab5d
core: add support for connection.dnssec 2025-10-13 11:57:53 +02:00
Robin Ebert
029f8be4c1
libnm-core: Add connection.dnssec property 2025-10-13 11:57:34 +02:00
Íñigo Huguet
e6a31264c1 merge: branch 'ih/ovs-external-ports'
ovs: don't remove unrelated external ports

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2296
2025-10-13 06:58:30 +00:00