Commit graph

34313 commits

Author SHA1 Message Date
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
Íñigo Huguet
86ea2c5963 man: ovs: document known limitation when removing ifaces and ports
Document a known limitation that we delete bridges and ports from ovsdb
when we remove their last NM-owned attached port or interface, even if
other externally added ports or interfaces exist.
2025-10-13 06:58:23 +00:00
Íñigo Huguet
93491d76ec ovs: don't remove unrelated external ports
The commit linked below introduced a bug that caused that OVS ports
added externally to NM are always deleted when we delete any OVS
interface. It affects to all externally added ports, including those
that are not related to the deleted interface and even those in
different OVS bridges.

Fix it by only modifying ports and bridges that are ascendants of the
deleted interface, leaving everything else untouched.

Note that bridges and ports still need to have at least one NM-managed
interface, otherwise they will also be purged. For example, an NM-owned
OVS bridge with 2 ports+iface, one NM-owned and one external: if we
delete the NM-owned iface, both ports and the bridge will be deleted.
For now, this is a known limitation that is not being fixed here.

Fixes: 476c89b6f2 ('ovs: only keep bridges and ports with NM interfaces attached')
2025-10-13 06:58:23 +00:00
Íñigo Huguet
b271e0a051 merge: branch 'filmsi/update-po'
Update Slovenian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2292
2025-10-10 14:51:37 +00:00
filmsi
f0f4d0dba0 Update Slovenian translation 2025-10-10 14:51:16 +00:00
Íñigo Huguet
4e10b1e6ab merge: branch 'hotfix/mstrodl/no-operator-code-retry'
wwan: retry after no operator code

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2270
2025-10-10 12:21:23 +00:00
Mary Strodl
52d08008b7
wwan: retry after no operator code
We've had a few rare instances where a modem stopped retrying
to autoconnect because it briefly didn't have an operator code.

This isn't a permanent failure, so we shouldn't abort completely
for it.
2025-10-10 08:16:57 -04:00
Íñigo Huguet
92aeed1f5c merge: branch 'patch-1'
Fix the exit test condition on modem state when creating the connection properties

Closes #1741

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2247
2025-10-09 06:42:22 +00:00
Christian Müller
018c5722ee Fix the exit test condition on modem state when creating the connection properties 2025-10-09 06:42:22 +00:00
Jan Vaclav
bf8b38618a NEWS: update 2025-10-08 22:52:14 +02:00
Jan Vaclav
17efec8b06 platform: configure HSR interlink from property
Uses the `hsr.interlink` property defined in the previous
commit to configure the property in the kernel.
2025-10-08 22:52:03 +02:00
Jan Vaclav
69d0fb161e libnm: introduce hsr.interlink property
This property allows the user to optionally configure
an interlink name on a HSR interface, so that it could
serve as RedBox (Redundant Box) by connecting DAN (dual
attachment node) to SAN (single attachment node).
2025-10-08 22:52:03 +02:00
Jan Vaclav
59c65bc859 merge: branch 'sktranslation_update'
Update Slovak translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2286
2025-10-07 10:31:27 +02:00
Jan Vaclav
a46827f899 merge: branch 'jv/hsr-version'
libnm: introduce `hsr.protocol-version` property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2283
2025-10-06 09:02:04 +00:00
Íñigo Huguet
6801ce4927 merge: branch 'catalan_fixes'
Fixes to Catalan translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2289
2025-10-03 11:21:26 +00:00
Jordi Mas
6e32a8e821 Fixes to Catalan translation 2025-10-03 11:21:15 +00:00
Íñigo Huguet
13d7469ba0 merge: branch 'wwan-device-name-restriction'
add gsm device-uid setting to restrict the devices the connection applies to

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2176
2025-10-03 11:03:13 +00:00
Michael Mokricky
820e56c5df add gsm device-uid setting to restrict the devices the connection applies to 2025-10-03 11:02:21 +00:00
Jan Vaclav
c27caec33d NEWS: update 2025-09-30 14:29:00 +02:00
Jan Vaclav
0b99629278 platform: configure HSR protocol version from property
Uses the `hsr.protocol-version` property defined in the previous
commit to configure the property in the kernel.
2025-09-30 14:28:49 +02:00
Jan Vaclav
9a2395c779 libnm: introduce hsr.protocol-version property
This property allows the user to set the protocol
version when using HSR. Currently, the property
supports two values - `2010` (referred to as HSRv0
in the kernel), and `2012` (HSRv1).
2025-09-30 14:28:48 +02:00
Jose Riha
ddb31034f9 Update Slovak translation 2025-09-26 17:34:34 +02:00
Íñigo Huguet
9e0551aefd core: document CleanupType
We must do different cleanups depending on the CleanupType. Document the
meaning of the different types as it was very confusing to work on new
code without having very clear what do they mean.
2025-09-24 11:30:59 +02:00
Íñigo Huguet
dbec15eb8d merge: branch 'ih/net-off-logging'
Improve logging of `networking off`

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2284
2025-09-24 05:21:21 +00:00
Íñigo Huguet
48fc40e1ca core: rename unmanaged flag SLEEPING->MANAGER_DISABLED
The flag is used for both sleeping and networking disabled conditions.
This is because internally they share logic, but it's not obvious for
users and it has caused confusion in the past when investigating why
devices didn't become managed. Make it explicit that it can be because
of either reason.

It would be better to create two separate flags, actually, and it
doesn't seem complex, but better not to risk introducing bugs for that
little benefit.

Logs before:
  device (enp4s0): state change: disconnected -> unmanaged (reason 'unmanaged-sleeping' ...

Logs before:
  device (enp4s0): state change: disconnected -> unmanaged (reason 'unmanaged-nm-disabled' ...
2025-09-23 09:17:07 +02:00
Íñigo Huguet
f6d6a7e2eb core, libnm: add the "networking off" reason
When we disable networking with `nmcli networking off` the reason that
is logged is "sleeping". Explain instead that networking is disabled.

Before:
  device (lo): state change: activated -> deactivating (reason 'sleeping' ...

After:
  device (lo): state change: activated -> deactivating (reason 'networking-off' ...
2025-09-23 09:17:07 +02:00
Íñigo Huguet
3355ba9380 core: rename NM_STATE_ASLEEP to NM_STATE_DISABLED
When we do `nmcli networking off` it's shown as state "sleeping". This
is confusing, and the only reason is that we share internally code to
handle both situations in a similar way.

Rename the state to the more generic name "disabled", situation that can
happen either because of sleeping or networking off.

Clients cannot differentiate the exact reason only with the NMState value,
but better that they show "network off" as this is the most common reason
that they will be able to display. If the system is suspending, there will
be only a short period of time that they can show the state, and showing
"network off" is not wrong because that's what NM has done as a response
to suspend.

In the logs, let's make explicit the exact reason why state is changing
to DISABLED: sleeping or networking off.

Logs before:
  manager: disable requested (sleeping: no  enabled: yes)
  manager: NetworkManager state is now ASLEEP

Logs after:
  manager: disable requested (sleeping: no  enabled: yes)
  manager: NetworkManager state is now DISABLED (NEWORKING OFF)

State before:
  $ nmcli general
  STATE  ...
  asleep ...

State after:
  $ nmcli general
  STATE       ...
  network off ...
2025-09-23 09:17:03 +02:00
Íñigo Huguet
c36e0bedeb NEWS: update 2025-09-12 15:11:56 +02:00
Íñigo Huguet
e570498fbf release: bump version to 1.55.4 (development) 2025-09-12 13:38:36 +02:00
Beniamino Galvani
40aa27690c initrd: support setting the DHCP client-id
In some cases it is necessary to set a custom DHCP client-id during
early boot. For example, the firmware of some InfiniBand NIC uses a
48-bit MAC derived from the InfiniBand 20-byte MAC when doing
PXE. NetworkManager doesn't have any knowledge of that 48-bit MAC and
uses the full MAC as client-id, therefore getting a different lease.

Introduce a new option 'rd.net.dhcp.client-id' to specify a custom
client-id.

Resolves: https://issues.redhat.com/browse/RHEL-108454

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2277
2025-09-11 17:33:46 +02:00
Íñigo Huguet
f472111e58 merge: branch 'ih/dbus-global-dns'
core: dns: fix the behavior of [global-dns]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2261
2025-09-11 10:26:06 +00:00
Íñigo Huguet
4a46f454da core: keep empty groups from keyfile configs
When reading NetworkManager.conf and NetworkManager-intern.conf we might
need to know if a group is defined or not, even if it's empty. This is
the case, for example, for [global-dns]. If [global-dns] is defined in
NM.conf overwrites the config from NM-intern, and if it's defined in any
of them they overwrite the configs from connections.

Before this patch, defining it as an empty group was ignored:
```
[global-dns]
```

Instead, it was necessary to add at least one key-value to the group.
Otherwise the group was silently ignored.
```
[global-dns]
searches=
```

Keep empty groups so we can take better decissions about overwritting
configs from other sources.
2025-09-11 10:25:36 +00:00
Íñigo Huguet
7fb4724efa core: dns: show in D-Bus if [global-dns] is defined but empty
Clients like nmstate needs to know if the [global-dns] section is
defined or not, so they know if DNS configs from connections are
relevant or not. Expose it in D-Bus by always exposing "searches"
and "options" if it's defined, maybe as empty lists.
2025-09-11 10:25:36 +00:00
Íñigo Huguet
1cba0a3cca dns: make [global-dns] to overwrite configs from connections
According to the documentation, settings from [global-dns] (searches and
options) are always merged with those from connections. However this was
not happening if no [global-dns-domain-*] exists, in which case
connections were ignored. This happened because in the past both global
sections must de defined or undefined. When this was changed to allow
defining only [global-dns], allowing it in the function that generates
the resolv.conf file was forgotten. Fix that now.

Anyway, merging these configs doesn't make much sense. The searches and
options defined in connections probably make sense only for the nameservers
defined in that same connection.

Because of this, make the following change: if global nameservers are
defined, use searches and options from [global-dns] only, because those
defined in connections may not make sense for the global nameservers. If
[global-dns] is missing, assume an empty [global-dns] section.

Also, if no global nameservers are defined, but [global-dns] is, make
that it overwrites the searches and options defined in connections. This
is not ideal, but none of the alternatives is better and at least this
is easy to remember.

So, the resulting rules from above are:
- If [global-dns] is defined, it always overwrite searches and options
  from connections.
- If [global-dns-domain-*] is defined, it always overwrite nameservers
  from connections. It overwrites searches and options too.

Fixes: 1f0d1d78d2 ('dns-manager: always apply options from [global-dns]')
Fixes: f57a848da5 ('man: update documentation about global DNS configuration')
2025-09-11 10:25:36 +00:00
Íñigo Huguet
294131a2a4 core: dbus: accept global DNS configuration without a default domain
Since 1.44 we accept a global-dns section without any global-dns-domain
section, so users can define searches and options without defining any
global DNS servers.

When set from the D-Bus API it was still rejected. Fix it.

Fixes: 1f0d1d78d2 ('dns-manager: always apply options from [global-dns]')
2025-09-11 10:25:36 +00:00
Íñigo Huguet
05efc6e253 merge: branch 'issue1476'
Fix reapply error with lacp_active

Closes #1476

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2275
2025-09-11 09:55:45 +00:00
Pradyumn Rahar
9c48bae3b2 bond: remove lacp_active option from reapply subset
NM_SETTING_BOND_OPTION_LACP_ACTIVE is flagged as BOND_OPTFLAG_IFDOWN in
the kernel and hence should not be in OPTIONS_REAPPLY_SUBSET.

Authored-by: Mohith Kumar Thummaluru <mohith.k.kumar.thummaluru@oracle.com>
Signed-off-by: Mohith Kumar Thummaluru <mohith.k.kumar.thummaluru@oracle.com>
Signed-off-by: Pradyumn Rahar <pradyumn.rahar@oracle.com>
2025-09-11 09:54:52 +00:00
Íñigo Huguet
1789a5b338 merge: branch 'ih/ip-reservation-use-after-free'
core: fix potential use after free

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2280
2025-09-11 09:47:40 +00:00
Íñigo Huguet
0d3fef3bcd core: fix potential use after free
_LOGD uses 'self', so don't unref it until after the _LOGD. Discovered
by Coverity.
2025-09-11 09:47:17 +00:00