Commit graph

34341 commits

Author SHA1 Message Date
Beniamino Galvani
c39b967a47 nmcli: print the band of wifi access points
It's a valuable information for users, especially because the channel
number can be ambiguous.

Before:
$ nmcli device wifi
IN-USE  BSSID              SSID   MODE   CHAN  RATE         SIGNAL  BARS  SECURITY
        42:00:00:AA:DD:CC  test   Infra  44    1170 Mbit/s  85      ▂▄▆█  WPA2
        92:00:00:AB:DD:CC  guest  Infra  44    1170 Mbit/s  85      ▂▄▆█  WPA2

After:
$ nmcli device wifi
IN-USE  BSSID              SSID   MODE   BAND     CHAN  RATE         SIGNAL  BARS  SECURITY
        42:00:00:AA:DD:CC  test   Infra  5 GHz    44    1170 Mbit/s  85      ▂▄▆█  WPA2
        42:00:00:AB:DD:CC  guest  Infra  5 GHz    44    1170 Mbit/s  85      ▂▄▆█  WPA2
2026-01-15 17:38:41 +01:00
Beniamino Galvani
7879acea8f libnm: export nm_utils_wifi_freq_to_band()
Clients typically want to show the band of an AP. The information is
already available because we export the frequency, but it is necessary
to implement some conversion logic.

Export libnm symbol nm_utils_wifi_freq_to_band() to do
that. Previously the function was used internally to generate the
value of the "band" string property from the frequency. For a public
function it is clearer if we return a enum value.
2026-01-15 17:38:41 +01:00
Thomas Makin
bb0a26e906 wifi: add support for new "6GHz" band
Until now the Wi-Fi bands were named after the first 802.11 standard
that introduced them: "a" for 5GHz introduced in 802.11a and "bg" for
2.4GHz introduced in 802.11b/g. With new bands added, this naming
scheme doesn't sound very intuitive to remember for users. Furthermore
we have now 6GHz that is introduced by 802.11ax (Wi-Fi 6), but the
compatible devices can use all three the bands (2.4, 5, 6 GHz).

For the 6 GHz band, simply name it "6GHz".

Co-authored-by: Beniamino Galvani <bgalvani@redhat.com>
2026-01-15 17:38:40 +01:00
Beniamino Galvani
5763b9b4de supplicant: fix center channel calculation
The formula is wrong for channels above 144 because the layout of the
80MHz channels is not regular. Use a lookup table.

Fixes: 7bb5961779 ('supplicant: honor the 'wifi.channel-width' property in AP mode')
2026-01-15 17:38:40 +01:00
Íñigo Huguet
ccc5f78fc4 merge: branch 'iwd-powersave'
device: Apply powersave configuration with iwd

Closes #1750

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2335
2026-01-15 08:55:43 +00:00
Vicki Pfau
5838c38b84 device: Apply powersave configuration with iwd
The powersave setting was apparently not touched at all in the iwd device,
so this adds the configuration, analogous to how the wifi device does.

Fixes #1750
2026-01-15 08:54:18 +00:00
Íñigo Huguet
57b6c1c5b7 merge: branch 'nmtui-wifi-rescan'
nmtui: feature: wifi-rescan feature for the nmtui.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2281
2026-01-15 07:55:48 +00:00
Rishabh Garg
221da3f8c0 nmtui: feature: wifi-rescan feature for the nmtui. 2026-01-15 07:55:48 +00:00
Íñigo Huguet
4cf6f0f9a8 merge: branch 'ih/spec_rm_snap'
spec: fix nmplugindir, remove snapshot and git_sha, move main info to the top

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2342
2026-01-13 07:14:16 +00:00
Íñigo Huguet
6d952902b9 spec: move the main info to the top
It's clearer this way, and it will allow to modify directly the
"Version:" and "Release:" fields to bump the version. It is more aligned
with the layout of other projects' spec files too.
2026-01-12 08:35:29 +01:00
Íñigo Huguet
5445ad2287 spec: remove snapshot and git_sha macros
Snapshot is only used from nm-copr-build.sh script, so not very useful.
Git_sha is used from build.sh. Other than that, downstream is always
nil.

Remove them and modify build.sh to use --define "dist xxx" instead of
them. This change is motivated by Packit not being able to modify the
release number if it has the %{snap} suffix.
2026-01-12 08:35:24 +01:00
Íñigo Huguet
9ebc8aa480 spec: fix nmplugindir
When dist_version is defined in meson, NM installs plugins to a
directory called `NetworkManager-${dist_version}`. If the dist version
contains a `~`, like `1.56~rc1`, defining nmplugindir with
`%{version_no_tilde}` makes it `NetworkManager-1.56-rc1`, causing
rpmbuild errors due to the mismatch.

Fix it by defining nmplugindir with `%{version}` instead.

Fixes: d975389bcd ('spec: use versioning scheme with ~dev and ~rc suffixes')
2026-01-09 08:44:37 +01:00
Beniamino Galvani
7cae64ac02 merge: branch 'bg/supplicant-blob-size'
supplicant: properly validate blobs

Closes #1850

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2334
2026-01-07 17:23:02 +00:00
Beniamino Galvani
eb784c3f27 supplicant: properly validate blobs
The purpose of the validation is to check that we pass to the
supplicant a configuration that it can understand. For certificates
and keys we enforce a maximum length of 64KiB; that means that the
value of the property we send (i.e. the file path or the blob id) can
be at most 64KiB. Instead we wrongly checked the size of the blob
data.

Fix the validation. Also, enforce a maximum blob size of 32MiB.

Fixes: e85cc46d0b ('core: pass certificates as blobs to supplicant for private connections')
2026-01-07 18:20:43 +01:00
Beniamino Galvani
c4b39914c4 core: limit the result from the helper to 32MiB 2026-01-07 18:20:43 +01:00
Íñigo Huguet
99514da050 merge: branch 'ih/versions-packit'
versioning: use everywhere the versioning scheme from the Git tags

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2332
2026-01-07 10:26:10 +00:00
Íñigo Huguet
4ce317a261 NEWS: update 2026-01-07 10:25:56 +00:00
Íñigo Huguet
9f4261168d release.sh: use versioning scheme with -dev and -rc suffixes
The previous commits has unified the versioning scheme to only use the
version names like 1.56-rc2, 1.56.2 and 1.57.1-dev, like the version
names that we use in the Git tags. The scheme with micro>=90 for RCs
will be used only internally, in the C headers. The tarballs will be
named with the new scheme.

Adapt the release.sh script to correctly understand this versioning
scheme and to create the tarballs with the right new name.

This will enable us to use Packit to automate rpm updates.
2026-01-07 10:25:56 +00:00
Íñigo Huguet
d975389bcd spec: use versioning scheme with ~dev and ~rc suffixes
In the previous commit meson.build was adapted to use versions with -dev
and -rc suffixes, as we create them in the Git tags, instead of versions
with micro>90 for RCs as we used to do. The tarball name will contain
the version with the new scheme, so adapt the spec file for it.

This will enable us to use Packit to do automatic updates.
2026-01-07 10:25:56 +00:00
Íñigo Huguet
e422b1c3d9 meson: specify project version with the -dev and -rc suffixes
This will create the tarball with names NetworkManager-1.56-rc2.tar.xz
or NetworkManager-1.57.1-dev.tar.xz. This way they will match with the
name of the Git tag, making easier for users, and specially for tools
like Packit, to understand the versioning scheme.

The goal is to make that there is only one public versioning scheme, the
one with -rc and -dev suffixes. Version numbers with micro>=90 for RC
releases is kept only as an internal thing for the C headers. Users of
the API can still use it.

Bump meson version to 0.56 to use str.substring().
2026-01-07 10:25:56 +00:00
Beniamino Galvani
19ac54fbd6 merge: branch 'bg/builtin-ping'
Use an internal "ping" implementation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2328
2026-01-07 09:16:19 +00:00
Beniamino Galvani
6b062dfeb5 rpm: drop weak dependency on iputils 2026-01-07 09:49:36 +01:00
Beniamino Galvani
de8d74aa08 device: use the internal ping implementation
Currently NetworkManager depends on the external ping binary to
perform the reachability check on IP addresses. This means that the NM
daemon package must depend on another package. On Fedora the iputils
package is 800KiB.

Implement the same functionality natively so that we can drop such
dependency.
2026-01-07 09:49:32 +01:00
Beniamino Galvani
90ea2ddb90 core: introduce nm_utils_ping_host()
Introduce a function that pings a given host. It opens a "ping socket"
(IPPROTO_ICMP), binds it to the given ifindex, connects it to the
remote address, and keep sending ICMP echo-request packets until it
receives a reply or the optional timeout is reached. By using this
kind of socket, the kernel automatically sets the ICMP ID on outgoing
packets and matches incoming packets by the same ID.
2026-01-07 09:48:00 +01:00
Íñigo Huguet
b416156b10 merge: branch 'bulgarian'
Update Bulgarian translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2331
2025-12-24 15:10:40 +00:00
twlvnn
9febe04761 Update Bulgarian translation 2025-12-24 15:08:56 +00:00
Íñigo Huguet
71b9d83349 merge: branch 'main'
Update Turkish translation

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2336
2025-12-24 15:08:10 +00:00
Muhammet Kara
664ba417c7 Update Turkish translation
Signed-off-by: Muhammet Kara <muhammetk@gmail.com>
2025-12-22 02:00:43 +03:00
Beniamino Galvani
a31a644f8b merge: branch 'bg/deprecate-wext'
build: deprecate Wireless Extensions

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2309
2025-12-18 15:14:45 +00:00
Beniamino Galvani
a45163b131 rpm: disable wireless extensions on Fedora
The Fedora kernel is built without WEXT since many years:

https://fedoraproject.org/wiki/Changes/RemoveWirelessExtensions
2025-12-18 16:06:44 +01:00
Beniamino Galvani
de1fcdcc72 build: deprecate Wireless Extensions
Wireless Extensions is the legacy, ioctl-based kernel interface used
to configure Wi-Fi cards. It has been deprecated and replaced by the
cfg80211/nl80211 API since 2007, as it doesn't support modern Wi-Fi
encryption and technologies. Mark it as deprecated, so that we can get
rid of some unmaintained and untested code in a future release.
2025-12-18 16:06:42 +01:00
Beniamino Galvani
a2d147366c Merge branch 'bg/issue1688'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2323
2025-12-17 11:59:20 +01:00
Beniamino Galvani
427a7cf257 nmcli: start the agent only after updating the connection
When connecting to a wifi network and providing the password on the
command line, nmcli first looks if there is a compatible connection to
reuse. If there is not, it creates and activates a new one via a
single call to AddAndActivate().

If there is a compatible connection, nmcli first calls Update() on it
to set the new password and then Activate() to bring it up. Before
that, it registers a secret agent that can prompt for a new password
in case of authentication failure.

However, as soon as nmcli registers a secret agent, NM tries to
activate again the connection if it was blocked due to a previous
authentication failure. This connection attempt is going to fail
because it still uses the old password, as new one hasn't been set via
Update().

Change the order of operations to register the agent after Update()
and before Activate().

Reproducer:

 nmcli device wifi connect SSID password BAD_PASSWORD
 nmcli device wifi connect SSID password GOOD_PASSWORD

Fixes: c8ff1b30fb ('nmcli/dev: use secret agent for nmcli d [wifi] connect')
2025-12-17 10:55:51 +01:00
Beniamino Galvani
3a4e18e302 nmcli: fix "device wifi connect" command with existing connection
Executing this command twice, or when a connection profile already
exists for the SSID:

  nmcli device wifi connect $SSID password $PASSWORD

returns error:

  Error: 802-11-wireless-security.key-mgmt: property is missing.

When setting the password nmcli was wiping the existing wireless
security setting.

Fixes: c8ff1b30fb ('nmcli/dev: use secret agent for nmcli d [wifi] connect')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1688
2025-12-17 10:55:50 +01:00
Íñigo Huguet
8e0825f9cd release: bump version to 1.57.1 (development) 2025-12-12 16:01:44 +01:00
Íñigo Huguet
df8288de7f merge: branch 'ih/strerror_r'
Fix two compilation issues

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2330
2025-12-12 14:36:58 +00:00
Íñigo Huguet
118475d571 ci: build with -D systemdsystemgeneratordir=no
Avoid build failures in some distros.
  ERROR: Assert failed: systemd required but not found, please provide a valid systemd user generator dir or disable it

Fixes: 636fb5ef24 ('systemd: install initrd services using a generator')
2025-12-12 15:24:09 +01:00
Íñigo Huguet
599cc1ed1d std-aux: use _nm_strerror_r
The function strerror_r returns an int per POSIX spec, but GNU version
returns char *. Using it fails the compilation in Alpine, so use
_nm_strerror_r instead that handles both cases.

Fixes: 41e28b900f ('daemon-helper: add read-file-as-user')
2025-12-12 15:07:53 +01:00
Íñigo Huguet
1756ec54e3 merge: branch 'issue1809'
CVE-2025-9615: avoid that non-admin user using other users' certificates.

Closes #1809

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2324
2025-12-12 12:29:41 +00:00
Beniamino Galvani
1a52bbe7c9 libnm: add function to copy a certificate or key as user
Add a new public function nm_utils_copy_cert_as_user() to libnm. It
reads a certificate or key file on behalf of the given user and writes
it to a directory in /run/NetworkManager. It is useful for VPN plugins
that run as root and need to verify that the user owning the
connection (the one listed in the connection.permissions property) can
access the file.
2025-12-12 12:43:15 +01:00
Beniamino Galvani
57eb4a5bc6 vpn: check that plugin supports private connections
Only allow private VPN connections if the VPN plugin declares the
supports-safe-private-file-access capability. Also check that the
private connection doesn't have more than one owner.
2025-12-12 12:42:01 +01:00
Beniamino Galvani
10db4baeb6 vpn: add nm_vpn_plugin_info_supports_safe_private_file_access()
The new API indicates that the VPN plugin supports reading files
(certificates, keys) of private connections in a safe way
(i.e. checking user permissions), or that it doesn't need to read any
file from disk.
2025-12-12 12:41:28 +01:00
Beniamino Galvani
8d8edda3f4 core,libnm-core: introduce property flag for certificate and keys
If we add a new property in the future and it references a certificate
or key stored on disk, we need to also implement the logic to verify
the access to the file for private connections.

Add a new property flag NM_SETTING_PARAM_CERT_KEY_FILE to existing
certificate and key properties, so that it's easier to see that they
need special treatment. Also add some assertions to verify that the
properties with the flag are handled properly.

While at it, move the enumeration of private-files to the settings.
2025-12-12 12:38:50 +01:00
Beniamino Galvani
e85cc46d0b core: pass certificates as blobs to supplicant for private connections
In case of private connections, the device has already read the
certificates and keys content from disk, validating that the owner of
the connection has access to them. Pass those files as blobs to the
supplicant so that it doesn't have to read them again from the
filesystem, creating the opportunity for TOCTOU bugs.
2025-12-12 12:38:50 +01:00
Beniamino Galvani
a1928b4459 device: read private files in stage2
During stage2 (prepare) of an activation, check if the connection is
private and if it contains any certificate/key path. If so, start
reading the files and delay stage2. Once done, store the files'
content into priv->private_files.table and continue the activation.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
9703305122 core: add functions to read private files of connections
Add function nm_utils_read_private_files(). It can be used to read a
list of paths as the given user. It spawns the daemon-helper to read
each path and returns asynchronously a hash table containing the files
content.

Also add nm_utils_get_connection_private_files_paths() to return a
list of file paths referenced in a connection. The function currently
returns only 802.1x file paths for certificates and keys.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
932b85f7e7 supplicant: rename variables
Rename uid to to blob_id, and con_uid to con_uuid.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
4e26403c4a core: support returning binary output from the daemon helper
The full output of the daemon helper is added to a NMStrBuf, without
interpreting it as a string (that is, without stopping at the first
NUL character).

However, when we retrieve the content from the NMStrBuf we assume it's
a string. This is fine for certain commands that expect a string
output, but it's not for other commands as the read-file-as-user one.

Add a new argument to nm_utils_spawn_helper() to specify whether the
output is binary or not. Also have different finish functions
depending on the return type.
2025-12-12 12:38:49 +01:00
Beniamino Galvani
bd2484d1a9 supplicant: remove blobs before adding new ones
When connecting, we add the blobs to the Interface object of the
supplicant. Those blobs are not removed on disconnect and so when we
try to add blobs with the same id, the supplicant returns an error.

Make sure we start from a clean slate on each connection attempt, by
deleting all existing blobs. Probably we should also delete the added
blobs on disconnect, but that's left for a future improvement.
2025-12-12 12:38:48 +01:00
Beniamino Galvani
41e28b900f daemon-helper: add read-file-as-user
Add a new command to read the content of a file after switching to the
given user. This command can be used to enforce Unix filesystem
permissions when accessing a file on behalf of a user.
2025-12-12 12:38:48 +01:00