Commit graph

33488 commits

Author SHA1 Message Date
Valentin Blot
9cb6424a18 wwan: remove buggy assertion
Removed an assertion that was not satisfied in the legitimate case of
IPv4 + do_auto.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2061
(cherry picked from commit 4082e7e109)
2024-11-14 10:00:53 +01:00
Beniamino Galvani
e17f1b93ec core: increase timeout for test_nm_utils_kill_child()
The test starts a watchdog process that eventually kills the process
group after a certain time. When running under valgrind concurrently
to other tests the current timeout is not enough; increase it.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2067
(cherry picked from commit 23ffa5fc6e)
2024-11-14 10:00:06 +01:00
Beniamino Galvani
fc09f55ef5 platform: fix to_string() functions for IPv6 tunnels
We can hit an assertion at trace log level when printing IPv6 tunnel
links, because the buffer for the local and remote addresses is not
big enough. Increase the buffer size.

Fixes: 32f6e1ef2e ('platform: add IP6TNL links support')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2063
(cherry picked from commit eb620e0e7e)
2024-11-14 09:59:56 +01:00
Gris Ge
c9e31e70cb sriov: only valid sriov capacity when enabled
NetworkManager current code will refuse to activate a connection if its
interface has no SRIOV capacity but holding a empty SRIOV settings.

This patch only valid SRIOV capacity when it is enabled(total_vfs > 0).

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

Signed-off-by: Gris Ge <fge@redhat.com>
(cherry picked from commit 421ccf8b4c)
2024-11-12 13:39:11 +01:00
Beniamino Galvani
f7415f1275 nmcli: fix handling of connection.down-on-poweroff property
Fix the following error:

  $ nmcli connection modify C connection.down-on-poweroff yes
  **
  nm:ERROR:../src/libnmc-setting/nm-meta-setting-desc.c:1367:_set_fcn_gobject_ternary: assertion failed: (_gobject_property_get_gtype(G_OBJECT(setting), property_info->property_name) == NM_TYPE_TERNARY)
  Bail out! nm:ERROR:../src/libnmc-setting/nm-meta-setting-desc.c:1367:_set_fcn_gobject_ternary: assertion failed: (_gobject_property_get_gtype(G_OBJECT(setting), property_info->property_name) == NM_TYPE_TERNARY)

Fixes: bd38a19832 ('connection: add support to down-on-poweroff')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2055
(cherry picked from commit 4af6cf592a)
2024-10-22 10:52:28 +02:00
Fernando Fernandez Mancera
acc9926e1d release: bump version to 1.50.0 2024-10-02 22:04:44 +02:00
Fernando Fernandez Mancera
622f188621 hsr: fix initialization of port1 and port2 DBus Object property
This was causing test_nml_dbus_meta() unit test to fail and also it was
affecting the notification when the object changed.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
(cherry picked from commit 1e70f24378)
2024-10-02 17:12:05 +02:00
Fernando Fernandez Mancera
f38dcdf57b hsr: add hsr setting to docs generate script
The setting was missing from the script. The patch is adding it and also
regenerates the docs.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
(cherry picked from commit a0696e27b8)
2024-10-02 17:12:00 +02:00
Fernando Fernandez Mancera
19929fdc9a hsr: use HSR DBus metadata properly
The HSR DBus metadata was defined properly but not exported on the libnm
library properly. This was causing that clients were not showing the HSR
devices.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
(cherry picked from commit 5e4696a693)
2024-10-02 17:11:53 +02:00
Fernando Fernandez Mancera
bba6cc31a4 introspection: fix indentation for HSR device introspection
The file was mixing spaces and tabs. It should only use spaces.

Fixes: 5426bdf4a1 ('HSR: add support to HSR/PRP interface')
(cherry picked from commit 4ff3bd3eb5)
2024-10-02 17:11:48 +02:00
Beniamino Galvani
d809ca6db2 device: fix bug when deactivating port connections asynchronously
When the attach_port()/detach_port() methods do not return immediately
(currently, only for OVS ports), the following situation can arise:

 - nm_device_controller_attach_port() starts the attachment by sending
   the command to ovsdb. Note that here we don't set
   `PortInfo->port_is_attached` to TRUE yet; that happens only after
   the asynchronous command returns;

 - the activation of the port gets interrupted because the connection
   is deleted;

 - the port device enters the deactivating state, triggering function
   port_state_changed()

 - the function calls nm_device_controller_release_port() which checks
   whether the port is already attached; since
   `PortInfo->port_is_attached` is not set yet, it assumes the port
   doesn't need to be detached;

 - in the meantime, the ovsdb operation succeeds. As a consequence,
   the kernel link is created even if the connection no longer exists.

Fix this by turning `port_is_attached` into a tri-state variable that
also tracks when the port is attaching. When it is, we need to perform
an explicit detach during deactivation.

Fixes: 9fcbc6b37d ('device: make attach_port() asynchronous')

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

Resolves: https://issues.redhat.com/browse/RHEL-58026
(cherry picked from commit a8329587c8)
2024-09-26 15:06:10 +02:00
Beniamino Galvani
f6e4e53775 libnm-core: fix validation of ovs-dpdk interface name
An ovs-dpdk interface doesn't have a kernel link and doesn't have the
15-character limit on the name.

Fixes: 3efe070dfc ('libnm: validate "connection.interface-name" at one place only')

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2044
(cherry picked from commit fda05b0af0)
2024-09-26 09:46:59 +02:00
Fernando Fernandez Mancera
025d78f710 release: bump version to 1.49.91 (1.50-rc2) (development) 2024-09-16 14:53:20 +02:00
Beniamino Galvani
4dde5aa787 l3cfg: ensure the probing timeout is initialized on probe start
When handling event TIMEOUT, "acd_data->probing_timeout_msec" needs to
be always initialized before jumping to "handle_start_probing:";
otherwise, an assertion failure is triggered at:

  static void
  _l3_acd_data_timeout_schedule_probing_restart(AcdData *acd_data, gint64 now_msec)
  {
    ...
    nm_assert(acd_data->probing_timeout_msec > 0);

Even if the ACD data is already in state PROBE, that doesn't mean that
the timeout is already initialized because the PROBE state can also be
reached from a INSTANCE_RESET event; and depending on the previous
state "acd_data->probing_timeout_msec" could be uninitialized.

Fixes-test: @iptunnel_restart
Fixes: b8f9d7b5dd ('l3cfg: rework ACD handling in NML3Cfg to support handling conflicts')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2023
(cherry picked from commit a09f9cc616)
2024-09-16 14:50:51 +02:00
Jan Vaclav
f6e4d1b2e0 nmtui: correctly check that connection list is non-empty
Previously, the "edit" or "delete" buttons were clickable even
if there were no available connections, which was not expected
and caused an assertion to fail when clicked. This is because
the connections list could contain connections that were later
filtered out and not displayed in the final list, but the check
did not take this into account.

Make it so that the buttons are clickable only if we *actually*
have any available connections to edit or delete.

Fixes: 3bda3fb60c ('nmtui: initial import of nmtui')
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1991
(cherry picked from commit c9fefcd095)
2024-09-16 14:50:42 +02:00
Fernando Fernandez Mancera
fec984e200 release.sh: update version check 2024-09-16 14:37:13 +02:00
Martin von Gagern
61e781c4f5 core: fix dhcp leases in l3cd cloning.
This will copy DHCP lease from src (not self), fixing an assertion in
nm_l3_config_data_new_clone.

Resolves: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1620
Fixes: 55b722820d ('l3cfg: fix nm_l3_config_data_new_clone() to make exact copy')
(cherry picked from commit a25d593922)
2024-09-16 12:40:52 +02:00
Beniamino Galvani
e34c7cd5a2 cloud-setup: fix placement of directives in the systemd unit
The "StartLimitIntervalSec" and "StartLimitBurst" directives should be
in the [Unit] section instead of the [Service] one.

Fixes: 927cff9f17 ('cloud-setup: allow bigger restart bursts')
(cherry picked from commit a531458456)
2024-09-16 12:40:26 +02:00
Beniamino Galvani
50da988182 ovs: fix assertion failure in netdev datapath mode
When using the netdev datapath, we wait for the link to appear in
different steps:

 1. initially, in act_stage3_ip_config() connects to platform's
   "link-changed" signal to detect when the TUN interface appears;

 2. when the interface appears, _netdev_tun_link_cb() schedules
   _set_ip_ifindex_tun() in a idle handler;

 3. _set_ip_ifindex_tun() checks if the link is ready (e.g. if the MAC
   address is correct) and in that case it reschedules stage3, which
   will move forward with the activation;

 4. if the link is not ready in _set_ip_ifindex_tun(), the function
   connects again to platform's "link-changed" signal to react to link
   changes;

 5. after the link changes and it is ready, _netdev_tun_link_cb()
   reschedules stage3, which moves forward with the activation;

With the current implementation it is possible that after step 2, if
act_stage3_ip_config() runs because it was already scheduled, it
registers again to the "link-changed" event; then when
_set_ip_ifindex_tun() is invoked it will hit assertion:

  nm_assert(!priv->wait_link.tun_link_signal_id);

Fix this by preventing that the signal gets registered again after
step 2.

Fixes-test: @ovs_datapath_type_netdev_with_cloned_mac

Fixes: acf485196c ('ovs-interface: wait that the cloned MAC changes instead of setting it')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2024
(cherry picked from commit b6e69f3467)
2024-09-16 12:40:03 +02:00
Fernando Fernandez Mancera
556231a5c9 release: bump version to 1.49.90 (1.50-rc1) 2024-08-30 14:14:15 +02:00
Lubomir Rintel
288ac99211 release: bump version to 1.49.6 (development) 2024-08-29 12:10:58 +02:00
Filip Pokryvka
72a410c1ad nmcli: fix bash completion for fields
The code handling options with supposes, that options
are split by `=`, which is not the case. This fixes the following:

```
nmcli -f ipv4.ad\t\t
nmcli -f ipv4.ad=ipv4.addresses

nmcli --field ipv4.ad\t\t
nmcli --field ipv4.ad=ipv4.addresses
```

Using options with values separated with `=` remains broken,
but this change doesn't affect it:

```
nmcli --field=ipv4.ad\t\t
nmcli --field=ipv4.ad
```

Also, `man` and `usage` uses `--color auto|yes|no`,
not `--color=auto|yes|no`. So, this fix should be sufficient.

Bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=2115827
2024-08-28 15:44:01 +02:00
Fernando Fernandez Mancera
d8c924caa2 merge: branch 'ih/sys-iface-state-log'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2018
2024-08-28 15:36:36 +02:00
Íñigo Huguet
7dae55f0f2 core: rename NM_DEVICE_MANAGED_TYPE_MANAGED to _TYPE_FULL
Managed type = managed is a bit unclear, because all managed types are
for devices that are managed, but with different levels. Managed type =
managed could be interpreted as other types are unmanaged. Change it to
managed type = full.
2024-08-28 15:35:56 +02:00
Íñigo Huguet
573c48d034 core: rename sys-iface-state to managed-type internally
The previous name was not very self explanatory. Managed type indicates
a bit better what the meaning is.
2024-08-28 15:35:56 +02:00
Íñigo Huguet
b2930f5361 log: show sys-iface-state as managed-type in log messages
This is a better hint for users about the meaning of this value.
2024-08-28 15:35:56 +02:00
Íñigo Huguet
72014db629 cloud-setup: azure: ensure that primary address is placed first
The primary address is that placed at position 0 of all the IP Addresses
of the interface. Sometimes we put it in a different position in the
ipv4s array because we insert them in the order we receive, but it might
happen that the HTTP responses comes back in wrong order.

In order to solve this, we pass the index of the IPv4 address to the
callback and the address is added in the right position directly.

Co-authored-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
2024-08-28 15:29:18 +02:00
Lubomir Rintel
927cff9f17 cloud-setup: allow bigger restart bursts
On daemon startup, we may end up enqueueing many nm-cloud-setup.service
restarts in very a short time. That is perfectly fine, just bump the
thresholds so that systemd doesn't get in the way too quickly.

100 requests in 1 seconds seem like a fair choice -- little bit on the
conservative side, yet still giving the service manager some room to
interfere on a chance things really go awry.

https://issues.redhat.com/browse/RHEL-49694
2024-08-28 11:26:11 +02:00
Íñigo Huguet
01bee5a6ad po: add nmtui/nmt-page-veth.c to POTFILES.in
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1943

Fixes: 187ff4c73b ('nmtui: add veth page')
Reported-by: Piotr Drąg
2024-08-27 09:59:54 +02:00
Íñigo Huguet
fedc37ac48 autotools: fix another filename that was renamed
Fixes: 090d617017 ('src: drop most master references from the code')
2024-08-22 14:44:06 +02:00
Fernando Fernández Mancera
f151952e29 merge: branch 'pre-down-no-network-fix'
device: don't enforce IP cleanup on deactivating state

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2016
2024-08-22 12:25:49 +00:00
Jonathan Kang
c61c552077 device: don't enforce IP cleanup on deactivating state
Don't enforce IP cleanup when devices are in deactivating state, to
make sure that network connection is still available for pre-down
dispatcher phase.

Fixes ac4e63ddda ('ip: support dhcp-send-release in NMSettingIpConfig')

https://bugzilla.suse.com/show_bug.cgi?id=1228154
2024-08-22 12:25:31 +00:00
Íñigo Huguet
56f3911b49 autotools: fix filename that was renamed
Fixes: 090d617017 ('src: drop most master references from the code')
2024-08-22 12:02:48 +02:00
Íñigo Huguet
63818a213b release: bump version to 1.49.5 (development) 2024-08-21 13:54:01 +02:00
Íñigo Huguet
1de0781146 CI: regenerate template 2024-08-21 10:52:49 +02:00
Íñigo Huguet
d5a7d859a5 debian: install policykit-1 or polkitd depending on the version
Old Debian and Ubuntu versions didn't have a separate polkitd yet. Make
both optional so it's installed the one that is available.
2024-08-21 10:37:42 +02:00
Íñigo Huguet
d899f8a1ca merge: branch 'ih/debian-polkit'
CI: fix some distros that fails to install

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2015
2024-08-21 07:59:07 +00:00
Íñigo Huguet
afefa1acde ci: remove CentOS Stream 8 (EOLd)
It even fails to download the image.
2024-08-21 09:00:05 +02:00
Íñigo Huguet
66636370f9 debian: install polkitd instead of policykit-1
Commit c19b5d76c2 ('contrib: install "policykit-1" package on Debian')
added policykit-1 because it was needed to get a translation file.

In recent Debian versions it has been removed. It was only a
transitional package to install polkitd and pkexec. Install polkitd
directly instead.
2024-08-21 08:56:06 +02:00
Íñigo Huguet
d299e000c6 NEWS: update with some of the latest changes 2024-08-21 08:17:33 +02:00
Íñigo Huguet
50c8e6e6b5 format: run nm-code-format 2024-08-21 08:13:08 +02:00
Íñigo Huguet
57c19db32b merge: branch 'lr/sad-nmcli-edit'
nmcli/edit: fix an assertion failure when tab-completing bad setting name

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2014
2024-08-21 05:41:12 +00:00
Lubomir Rintel
5b7e7feccd nmcli/edit: fix an assertion failure when tab-completing bad setting name
Attempt to tab-complete a property from a setting which does not exist
results in an assertion failure:

  nmcli > set lala.lala<TAB>

  (process:597363): nm-CRITICAL **: 16:30:21.642: nm_meta_setting_info_editor_find_by_name: assertion 'setting_name' failed

  Thread 1 "nmcli" received signal SIGTRAP, Trace/breakpoint trap.
  0x00007ffff780dc28 in g_logv () from /lib64/libglib-2.0.so.0
  (gdb) bt
  #0  0x00007ffff780dc28 in g_logv () at /lib64/libglib-2.0.so.0
  #1  0x00007ffff780dea3 in g_log () at /lib64/libglib-2.0.so.0
  #2  0x000000000044a2c2 in nm_meta_setting_info_editor_find_by_name (setting_name=<optimized out>, use_alias=use_alias@entry=0)
      at src/libnmc-setting/nm-meta-setting-access.c:35
  #3  0x000000000042eb07 in get_setting_and_property (prompt=<optimized out>, line=<optimized out>, setting_out=0x7fffffffcf10, property_out=0x7fffffffcf18)
      at src/nmcli/connections.c:6639
  #4  0x000000000042ec38 in get_allowed_property_values (out_to_free=out_to_free@entry=0x7fffffffcf50) at src/nmcli/connections.c:6711
  #5  0x000000000042ed8c in should_complete_property_values (prompt=prompt@entry=0x5befb0 "nmcli 802-1x.pac-file> ", line=line@entry=0x0, multi=multi@entry=0x7fffffffcfe4)
      at src/nmcli/connections.c:6735
  #6  0x000000000042f5d8 in nmcli_editor_tab_completion (text=0x5bef90 "lala", start=<optimized out>, end=13) at src/nmcli/connections.c:6899
  #7  0x00007ffff776dcdc in gen_completion_matches () at /lib64/libreadline.so.8
  ...

Do not proceed resolving the setting name if it does not pass
check_valid_name().
2024-08-21 05:40:46 +00:00
Íñigo Huguet
2bc5c56119 merge: branch 'jv/edit-memory-leak'
nmcli/edit: fix memory leak in extract_setting_and_property

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2013
2024-08-21 05:40:17 +00:00
Jan Vaclav
ca47fd882e nmcli/edit: fix memory leak in extract_setting_and_property
In case the user selects a setting/property with "goto" command, and
then attempts to tab-complete a setting/property pair, the original sett
and prop strings are overriden without freeing:

  nmcli > goto 802-1x.pac-file
  nmcli 802-1x.pac-file> set 802-1.lal<TAB>

Fixes: 79bc271685 ('cli: TAB-completion for enum-style property values (rh #1034126)')
2024-08-21 05:40:01 +00:00
Íñigo Huguet
76285d321f merge: branch 'bg/hostname-retry'
policy: retry hostname resolution when it fails

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2006
2024-08-21 05:39:43 +00:00
Beniamino Galvani
04ad4c86d0 policy: retry hostname resolution when it fails
Currently if the system hostname can't be determined, NetworkManager
only retries when something changes: a new address is added, the DHCP
lease changes, etc.

However, it might happen that the current failure in looking up the
hostname is caused by an external factor, like a temporary outage of
the DNS server.

Add a mechanism to retry the resolution with an increasing timeout.

https://issues.redhat.com/browse/RHEL-17972
2024-08-21 05:39:22 +00:00
Íñigo Huguet
2c9aa712f9 merge: branch 'ih/sl-po'
po: Update Slovenian (sl) po file

Closes #1602

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2011
2024-08-21 05:38:30 +00:00
Martin
15be563f7a po: Update Slovenian (sl) po file 2024-08-21 05:36:23 +00:00
Íñigo Huguet
1b74651a60 merge: branch 'ih/resync_backoff'
platform: add small backoff time before resync

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2010
2024-08-21 05:35:25 +00:00