Commit Graph

33346 Commits

Author SHA1 Message Date
Íñigo Huguet
73602b9d98 merge: branch 'ndisc-allow-multiple-gateways'
ndisc: support multiple gateways for a single network

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1952
2024-06-28 11:17:51 +00:00
Stefan Agner
f766059ea8 ndisc: support multiple gateways for a single network
Also check for gateway equality when deduplicate routing entries. This
allows to support multiple routes to the same network using different
gateways. This is useful for Thread networks where multiple BRs route
to the same Thread network. If one of these BRs go offline, fallback to
a different router will be much quicker if multiple entries are present.

Note that quick fallback to a different router requires IPv6
reachability probe to be active. Typically Linux disables reachability
probes on Linux machines which act as IPv6 gateway (when forwarding is
enabled).
2024-06-28 11:17:37 +00:00
Íñigo Huguet
7be55d6eff merge: branch 'jv/nmtui-veth'
nmtui: add veth page

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943
2024-06-28 11:02:11 +00:00
Jan Vaclav
e74f506b81 nmtui: include veth devices in activation dialog 2024-06-28 11:01:51 +00:00
Jan Vaclav
187ff4c73b nmtui: add veth page
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943
2024-06-28 11:01:51 +00:00
Íñigo Huguet
c2e6959af2 merge: branch 'jv/fix-newt-error-handling'
nmtui: handle write() errors correctly in nmt_newt_edit_string

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1971
2024-06-28 10:58:20 +00:00
Jan Vaclav
13317bd536 nmtui: handle write() errors correctly in nmt_newt_edit_string
It might happen that write() returns -1, but the errno is not EINTR.
In that case, the length would be incremented by 1, and the data pointer
to the data being written would be moved back by 1 byte on every error.

Make it so that the function exits with an error if it indicates an error.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1971

Fixes: 3bda3fb60c ('nmtui: initial import of nmtui')
2024-06-28 10:58:11 +00:00
Íñigo Huguet
4b66f9fe71 merge: branch 'ih/distros-info-yml'
ci: add file with info about distros that we test

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1977
2024-06-28 10:56:48 +00:00
Íñigo Huguet
e15a9aa1a5 ci: add file with info about distros that we test
Useful to have easily accessible the info of all the distros that we
test, including the version of NM that they ship and their EOL dates so
we can know when to stop testing them.

For now this is only informative, but we can use this info, for example,
to generate the `.gitlab-ci/config.yml` file automatically for each
stable branch.
2024-06-28 10:56:28 +00:00
Beniamino Galvani
c759525e99 merge: branch 'bg/dhcp-remove-addr-on-expiry'
dhcp: remove the address synchronously on lease expiry

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1532
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1939
2024-06-28 07:44:23 +00:00
Beniamino Galvani
514a3cb610 dhcp: remove the address synchronously on lease expiry
When the lease expires, the DHCP client emits a LEASE_UPDATE event
with a NULL l3cd. After returning from the handler, it sends
immediately a DHCP DISCOVER message to try to get a new lease.

It is important that when the DISCOVER gets sent the address is no
longer configured on the interface. Otherwise, the server could see
that it is already in use and assign a different one. Therefore,
remove the address synchronously when handling the event.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1532
2024-06-28 09:42:11 +02:00
Jan Vaclav
593b4e01a4 gitlab-ci: ensure coverity job runs weekly
Currently, the condition is not strict enough, and so the job runs every time a scheduled task is triggered - which is currently daily.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1979
2024-06-28 07:35:32 +00:00
Jan Vaclav
c9327b2e8b agent: print error message character in hex form if it's unprintable
Currently, when the agent manager is sent a registration request
containing UTF-8 characters, it will form an invalid error message
using only one of the bytes from the UTF-8 sequence, which causes
an assertion in glib to fail, which replaces the returned error message
with "[Invalid UTF-8]". It will also print an assertion failure to the
console, or crash NetworkManager on non-release builds.

This commit makes it so that it instead prints out the character in
hexadecimal form if it isn't normally printable, so that it is once
again a valid UTF-8 string.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1965

Fixes: a30cf19858 ('agent: add agent manager and minimal agent class')
2024-06-27 11:24:57 +00:00
Lubomir Rintel
6de187cb37 nmcli: always clean up readline on exit
A signal handler is not the only place where we need to clean up after
an in-progress readline() on exit; we may do so when erroring out as
well:

Before (not also the missing line break, which is part of the cleanup):

  $ (sleep 10; nmcli c del 'Red Hat Wi-Fi')
  $ nmcli --ask d wifi connect 'Red Hat Wi-Fi'
  Passwords or encryption keys are required to access the wireless network 'Red Hat Wi-Fi'.
  Password (802-11-wireless-security.psk): Error: Connection activation failed: The device's active connection disappeared.
  $ [terminal messed up, no echo]

After:

  $ (sleep 10; nmcli c del 'Red Hat Wi-Fi')
  $ nmcli --ask d wifi connect 'Red Hat Wi-Fi'
  Passwords or encryption keys are required to access the wireless network 'Red Hat Wi-Fi'.
  Password (802-11-wireless-security.psk):
  Error: Connection activation failed: The device's active connection disappeared.
  $ hello [terminal echo fine, wheee]

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1959
2024-06-26 14:15:16 +02:00
Jan Vaclav
508d43efc9 gitlab-ci: add coverity submissions to weekly scheduled CI
We currently submit builds to Coverity manually every now and then,
but it would make sense to submit them more frequently and periodically,
so that it can detect defects sooner.

Add a "coverity" stage to the pipeline, which submits a build to Coverit
(the scheduls currently set to run every week).

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1973
2024-06-26 12:58:03 +02:00
Beniamino Galvani
14eaf4e419 merge: branch 'bg/netlink-strict-check'
Enable strict check on the netlink socket

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1962
2024-06-26 07:54:02 +00:00
Beniamino Galvani
185932a1a2 platform: enable strict check on netlink socket dumps
In the future we might want to specify filters when requesting netlink
dumps; this requires that strict check is enabled on the socket.

When enabling strict check, we need to pass a full struct in the
netlink message, otherwise kernel ignores it.

This commit doesn't change behavior.
2024-06-26 09:52:50 +02:00
Beniamino Galvani
2b8d8fe92a platform: don't set RTM_F_LOOKUP_TABLE for IPv6
RTM_F_LOOKUP_TABLE is only needed for IPv4. IPv6 dumps with the flag
are rejected in strict mode.
2024-06-26 09:52:50 +02:00
Beniamino Galvani
cac8c445e0 merge: branch 'feature/mstrodl/connectivity-timeout'
Add a timeout option to connectivity checks

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1968
2024-06-25 08:12:44 +00:00
Mary Strodl
ed318e8774 connectivity: Add a timeout option to connectivity checks
Adds an option in the connectivity section to change the timeout before
the interface is deemed "limited". Previously, it was hardcoded to
20 seconds, but for our usecase (failing over to cell modem if
hardwired ethernet drops), it's nice to be able to failover to another
interface more quickly.
2024-06-24 09:21:34 +00:00
Beniamino Galvani
0d657af256 crypto: regenerate PKCS#12 certificates
The PKCS#12 certificates are using SHA1 and RC2-40, which are deprecated;
regenerate them with:

 $ openssl pkcs12 -export -in test_key_and_cert.pem -inkey test_key_and_cert.pem -certfile test_ca_cert.pem -name "test-pkcs12" -out test-cert.p12
 (key: test)

 $ openssl pkcs12 -export -in test2_key_and_cert.pem -inkey test2_key_and_cert.pem -certfile test2_ca_cert.pem -name "test2-pkcs12" -out test2-cert.p12
 (key: 12345testing)

Before:
 $ openssl pkcs12 -info -in test-cert.p12
 MAC: sha1, Iteration 2048
 MAC length: 20, salt length: 8
 PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 2048

After:
 $ openssl pkcs12 -info -in test-cert.p12
 MAC: sha256, Iteration 2048
 MAC length: 32, salt length: 8
 PKCS7 Encrypted data: PBES2, PBKDF2, AES-256-CBC, Iteration 2048, PRF hmacWithSHA256
2024-06-24 09:48:42 +02:00
Beniamino Galvani
d2536a7d7f valgrind: update suppression for memmove and inet_pton6
inet_pton6() can be called from different functions, make the
suppression more generic.
2024-06-21 23:03:11 +02:00
Beniamino Galvani
97324356cd release: bump version to 1.49.1 (development) 2024-06-21 15:24:07 +02:00
Gris Ge
606283afdc merge: branch 'bg/ovs-interface-by-mac'
ovs: allow specifying a system OVS interface by MAC address

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1975
2024-06-21 07:50:15 +00:00
Beniamino Galvani
be28a11735 ovs: allow specifying a system OVS interface by MAC address
The OVS interface can be matched via MAC address; in that case, the
"connection.interface-name" property of the connection is empty.

When populating the ovsdb, we need to pass the actual interface name
from the device, not the one from the connection.

Fixes: 830a5a14cb ('device: add support for OpenVSwitch devices')

https://issues.redhat.com/browse/RHEL-34617
2024-06-20 17:02:01 +02:00
Jan Vaclav
a5333f14b5 nm-in-container: create conf.d file instead of modifying journald.conf
Currently, the Dockerfile expects /etc/systemd/journald.conf to exist on the base container,
but sometimes this may not be the case, for example on Fedora 40, which causes
the build process to fail if the host machine is also running Fedora 40.

Update the dockerfile to create a conf.d file instead, which has higher precedence.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1972
2024-06-19 11:47:51 +00:00
Íñigo Huguet
8924bfe18c merge: branch 'jv/add-missing-vaargs'
gen-metadata-nm-settings-nmcli: add missing va_end in _prop_log() after using vaargs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1970
2024-06-19 11:10:58 +00:00
Jan Vaclav
7d0115ea98 gen-metadata-nm-settings-nmcli: add missing va_end in _prop_log() after using vaargs
It was missing before.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1970

Fixes: af5c1c8019 ('man nm-settings-nmcli: autogenerate the "Format" field')
2024-06-19 11:10:46 +00:00
Íñigo Huguet
51531a055f merge: branch 'out-or-range-typo'
libnm: fix typo

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1969
2024-06-19 11:07:25 +00:00
Anders Jonsson
bdb2a488c3 libnm: fix typo 2024-06-19 11:06:59 +00:00
Íñigo Huguet
270285e82a merge: branch 'lr/dac-override-comment'
service: remove a misleading comment

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1963
2024-06-19 11:06:21 +00:00
Lubomir Rintel
fe65ca77d7 service: remove a misleading comment
The comment makes it sounds as if we could do without CAP_DAC_OVERRIDE
if we don't use OpenVSwitch, which is not true. At the very least it's
needed by the VPN plugins we spawn to access cert/key material from
users' homes.
2024-06-19 11:05:49 +00:00
Íñigo Huguet
3ade788716 merge: branch 'th/fedora-22-wifi-mac-addr-conf'
[th/fedora-22-wifi-mac-addr-conf] contrib/rpm: rename section in "22-wifi-mac-addr.conf"

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1936
2024-06-19 11:03:28 +00:00
Thomas Haller
439ddc5101 contrib/rpm: rename section in "22-wifi-mac-addr.conf"
For [connection*] and [device*] sections, any suffix is allowed in
the group.

However (at least for configuration snippets we ship upstream), we
want to give a suffix that matches the name of the configuration
snippet.

It seems more common to use [connection-*] instead of [connection.].
See also "examples/nm-conf.d/*.conf" and "15-carrier-timeout.conf" file
which contains a [device-15-carrier-timeout] section.

Note that this file (in Fedora) is not configuration (installed in
/usr/lib). It is thus not problematic to modify.

Fixes: ea8dbd7a6d ('contrib/rpm: add "22-wifi-mac-addr.conf" to F40+')
2024-06-19 11:02:55 +00:00
Íñigo Huguet
5b215e97b9 merge: branch 'bg/leak'
libnm-core: fix memory leak in nm_setting_to_string()

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1934
2024-06-19 11:02:20 +00:00
Beniamino Galvani
ee5f4402bf libnm-core: fix memory leak in nm_setting_to_string()
Fixes: f957ea2b34 ('core/setting: rework nm_connection_dump()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1934
2024-06-19 11:01:46 +00:00
Íñigo Huguet
5f82c777a8 merge: branch 'bg/wifi-p2p-pending-action'
Fix pending action for WiFi P2P

Closes #1004

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1925
2024-06-19 11:01:24 +00:00
Beniamino Galvani
82032955dd wifi-p2p: consider if the device is enabled when adding pending action
If the device gets rfkill-blocked, remove the pending action
"waiting-for-supplicant", as it can prevent reaching
"startup-complete".

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1004
2024-06-19 11:01:07 +00:00
Beniamino Galvani
6a9f61122e wifi-p2p: implement get_enabled()/set_enabled()
Add function to set and report the rfkill state. For now, only print a
message; the state will be used in the next commit.
2024-06-19 11:01:07 +00:00
Beniamino Galvani
334177bdc3 wifi-p2p: don't add pending action for group interface
The group interface is only used during activation; there is no need
to add a pending action for it, because when the device is in
activating state it already delays "startup-complete" via other
pending actions.
2024-06-19 11:01:07 +00:00
Íñigo Huguet
d4204dc452 merge: branch 'jv/del-unused-logging'
core/logging: remove unused nm_logging_init_pre() function

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1902
2024-06-19 11:00:23 +00:00
Jan Vaclav
1b08fa88e1 core/logging: remove unused nm_logging_init_pre() function
This function is not being used anywhere and is triggering an alert in Coverity scans.
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1902
2024-06-19 10:59:56 +00:00
Beniamino Galvani
6c5faf6054 NEWS: update for 1.50 2024-06-19 11:02:02 +02:00
Íñigo Huguet
730752bfc5 merge: branch 'ih/secret_hint_tags'
vpn: handle hint tags in the daemon

Closes #1536

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1958
2024-06-18 14:01:02 +00:00
Íñigo Huguet
18240bb72d libnmc: don't strip prefix tags from secret names
The daemon is now capable of understanding and removing these prefix
tags by itself. It is better than this is not a responsibility of the
secret agent because it requires changes in all secret agents to work
properly (see https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1536).

If the secret agent knows what these prefix tags are, it can remove them
only in the text that is displayed in the UI, but maintaining the
original string as the secret name that is returned to the daemon.

Secret agents that doesn't know what these prefix tags are won't do
anything with them, and they will also return the same string as secret
name, as expected. The only drawback is that they might display the full
string to the user, which is not a nice UX but it will at least work.

Also, allow to translate the secret name for the UI in libnmc.
2024-06-18 14:00:38 +00:00
Íñigo Huguet
0583e1f843 vpn: handle hint tags in the daemon
Commit 345bd1b187 ('libnmc: fix secrets request on 2nd stage of 2FA
authentication') and commit 27c701ebfb ('libnmc: allow user input in
ECHO mode for 2FA challenges') introduced 2 new tags that hints for the
secret agents can have as prefix.

These tags were processed (and removed) in the secret agents, not in the
daemon. This is wrong because a system with an updated VPN plugin but a
not yet updated secret agent (like nm-plasma) will fail: it won't remove
the prefix and the daemon will save the secret with the prefix, i.e.
"x-dynamic-challenge:challenge-response" instead of just
"challenge-response". Then, VPN plugins doesn't recognize it, failing the
profile's activation. This is, in fact, an API break.

Also, if the VPN connection already existed before updating NM and the
VPN plugin, the secret flags are not added to the profile (they are only
added when the profile is created or modified). This causes the user's
first time response is saved to the profile, so the activation fails the
second and next times.

See:
- https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1536
- https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/issues/142

Anyway, in a good design the daemon should contain almost all the logic
and the clients should keep as simple as possible. Fix above's problems
by letting the daemon to receive the secret names with the prefix
already included. The daemon will strip it and will know what it means.

Note that this is done only in the functions that saves the secrets from
the data received via D-Bus. For example, nm_setting_vpn_add_secret
doesn't need to do it because this value shouldn't come from VPN
plugin's hints.
2024-06-18 14:00:38 +00:00
Íñigo Huguet
8f3b4f06bb merge: branch 'ih/triage_wf'
triage: improvements to issues workflow

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1949
2024-06-18 12:22:24 +00:00
Íñigo Huguet
cf86af6cbd Explain new issues workflow and add triage automation
Add explanation of how to indicate the new issues workflow to
MAINTAINERS.md: triage -> investigation -> devel. The different
stages are indicated using Gitlab's scoped labels (mutually exclusive).

These stages try to hightlight that the issue cannot be fixed and it's
not moving forward because more info is needed, already.  Also, add a
section to CONTRIBUTING.md highlighting the importance of helping in
the triage and investigation stages: developers often cannot fix bugs
because lack of time to investigate, but even users that doesn't know
how to fix it due to lack of knowledge of the code base can help thanks
to their knowledge on networking.

Finally, make the 'triage:issues' CI job to work again, adding some
new policies with new automations. The automation will add or remove the
labels: stale, help-needed::{triage, investigation, devel} and
unassigned.

The labels help-needed::* and unassigned will be automatically added to
all issues without an assignee. This reflects better the reality of not
having enough time to work on most of the issues unless there is some
external help.
2024-06-18 13:11:58 +02:00
Fernando Fernandez Mancera
99f22526ec merge: branch 'ff/drop_autotools_jobs'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1956
2024-05-31 16:53:50 +02:00
Fernando Fernandez Mancera
f6be3c0cb1 gitlab: move Fedora rawhide and C9S to tier 2
As discussed [1], we are using a lot of resources from freedesktop org.
Let's reduce the number of distributions tested in tier1 to just one.

[1] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1549
2024-05-31 16:53:02 +02:00