Commit Graph

33459 Commits

Author SHA1 Message Date
Íñ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
Íñigo Huguet
830dd4ad9c platform: add small backoff time before resync
If the socket's RX buffer is full it's probably because other
process is doing lot of changes very quickly, faster than we
can process them. Let's give the writer a small time to finish:
1. Avoid contending the kernel's RTNL lock, so we don't make
   the whole situation even worse and it can finish earlier.
2. Avoid having to resync again and again due to trying to
   resync while the writer is still doing quick changes, so
   we are unable to catch up yet.

This won't help if this situation takes a long time or is
continuous, but that's unlikely to happen, and if it does,
it's the writer's fault for starving the whole system.

There is no need to progresively increase the backoff time
for the same reason: if this situation takes lot of time,
it's the writer's fault. It's neither a good idea because the whole NM
process will end being sleeping long times, not doing anything at all,
without being able to react when the Netlink messages burst stops.
2024-08-21 07:32:22 +02:00
Íñigo Huguet
926bfab5b5 merge: branch 'bg/bridge-vlan-reapply'
Support reapplying bridge port VLANs

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2002
2024-08-21 05:30:37 +00:00
Beniamino Galvani
447e50d74e bridge: reapply port VLANs only when necessary
Don't touch the bridge VLANs if they are already set.
2024-08-21 07:29:41 +02:00
Beniamino Galvani
1c43fe5235 platform: add nmp_utils_bridge_normalized_vlans_equal()
Add a function to compare two arrays of NMPlatformBridgeVlan. It will
be used in the next commit to compare the VLANs from platform to the
ones we want to set.

To compare in a performant way, the vlans need to be normalized (no
duplicated VLANS, ranges into their minimal expression...). Add the
function nmp_utils_bridge_vlan_normalize.

Co-authored-by: Íñigo Huguet <ihuguet@redhat.com>
2024-08-21 07:29:39 +02:00
Beniamino Galvani
7ae4660a77 platform: support reading bridge VLANs
Add a function to read the list of bridge VLANs on an interface.
2024-08-21 07:29:38 +02:00
Beniamino Galvani
c5d1e35f99 device: support reapplying bridge-port VLANs
For now, always reapply the VLANs unconditionally, even if they didn't
change in kernel.

To set again the VLANs on the port we need to clear all the existing
one before. However, this deletes also the VLAN for the default-pvid
on the bridge. Therefore, we need some additional logic to inject the
default-pvid in the list of VLANs.

Co-authored-by: Íñigo Huguet <ihuguet@redhat.com>
2024-08-21 07:29:37 +02:00
Beniamino Galvani
e00c81b153 bridge: change the signature for nm_platform_link_set_bridge_vlans()
Currently, nm_platform_link_set_bridge_vlans() accepts an array of
pointers to vlan objects; to avoid multiple allocations,
setting_vlans_to_platform() creates the array by piggybacking the
actual data after the pointers array.

In the next commits, the array will need to be manipulated and
extended, which is difficult with the current structure. Instead, pass
separately an array of objects and its size.
2024-08-21 07:29:36 +02:00
Beniamino Galvani
7d3bfb101f platform: add define for IFLA_BOND_SLAVE_PRIO
The enum value was added in kernel 5.19; add a define for it so that
the compilation doesn't fail with earlier kernels.

Fixes: 79221f79a2 ('src: drop most slave references from the code')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1596
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2012
2024-08-20 13:29:48 +02:00
Fernando Fernandez Mancera
79c1f8c93a merge: branch 'th/lldp-fix-crash'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2007
2024-08-19 12:55:26 +02:00
Thomas Haller
4365de5226 lldp: fix multiple access to argument in logging macro
Fixes: 630de288d2 ('lldp: add libnm-lldp as fork of systemd's sd_lldp_rx')
2024-08-19 12:51:34 +02:00
Thomas Haller
c2cddd3241 lldp: fix crash dereferencing NULL pointer during debug logging
During nm_lldp_neighbor_parse(), the NMLldpNeighbor is not yet added to
the NMLldpRX instance. Consequently, n->lldp_rx is NULL.

Note how we use lldp_x for logging, because we need it for the context
for which interface the logging statement is.

Thus, those debug logging statements will follow a NULL pointer and lead
to a crash.

Fixes: 630de288d2 ('lldp: add libnm-lldp as fork of systemd's sd_lldp_rx')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1550
2024-08-19 12:51:34 +02:00
Fernando Fernandez Mancera
24b8d6b662 release: bump version to 1.49.4 (development) 2024-08-09 16:35:10 +02:00
Fernando Fernandez Mancera
ccee88ad5a merge: branch 'ff/drop_offensive_code'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1984
2024-08-09 15:48:34 +02:00
Fernando Fernandez Mancera
ad68b28843 config: parse autoconnect-ports value on config
As part of the conscious language effort we must provide an alternative
option to configure autoconnect-ports system-wide on NetworkManager
configuration file.
2024-08-09 15:47:32 +02:00
Fernando Fernandez Mancera
3203eb3df0 dbus-interface: rename activation flag to use conscious language 2024-08-09 15:47:32 +02:00
Fernando Fernandez Mancera
79221f79a2 src: drop most slave references from the code
While we cannot remove all the references to "slave" we can remove most
of them.
2024-08-09 15:47:32 +02:00
Fernando Fernandez Mancera
090d617017 src: drop most master references from the code
While we cannot remove all the references to "master" we can remove most
of them.
2024-08-09 15:47:32 +02:00
Thomas Haller
47283b7c76 deamon-helper: ensure helper_complete() never returns NULL on success
The in_buffer is initialized with a NULL buffer. If we never receive and
data, the buffer might still be NULL.

Maybe it actually can never happen, but it's not clear that this is
always the case. To be sure, ensure we don't return a NULL buffer on
success.
2024-08-09 15:24:11 +02:00
Fernando Fernandez Mancera
9f6ecbae69 keyfile: do not write offensive terms into keyfile
As part of the conscious language efforts we are not writing offensive
terms into keyfiles anymore. This won't break users upgrading as we
still read such values if they are present into the keyfile.

For existing profiles, NetworkManager will remove the offensive terms
when editing the keyfile.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2009
2024-08-09 15:14:16 +02:00
Íñigo Huguet
8488162d10 merge: branch 'patch-1'
Python gi examples little fix and refactor

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1997
2024-08-06 10:17:24 +00:00
Isidro Arias
4484397a0c examples: take lines out of loop (refactor)
since they will only be executed once.

Also, an error is raised if a connection is not found
2024-08-06 10:17:13 +00:00
Isidro Arias
f141f4bbe7 examples: fix gnome.org link 2024-08-06 10:17:13 +00:00
Isidro Arias
75350b3e76 examples: fix print parenthesis place in get_ips.py
Fixes: 797d9c4403 ('python: make dbus, gi examples, and debug-helper.py python3 ready')
2024-08-06 10:17:13 +00:00
Íñigo Huguet
63f2401ebe merge: branch 'bg/route-dump'
platform: dump only selected route protocols

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1978
2024-08-06 10:16:13 +00:00
Íñigo Huguet
d219277f1a platform: log routes dump failure as error 2024-08-06 10:15:56 +00:00
Beniamino Galvani
7efab8baeb platform: add a retry mechanism in case route dump fails
In case the platform fails dumping a specific route protocol, retry
multiple times. If all attempts fail, emit a warning and proceed as
there is nothing more to do.
2024-08-06 10:15:56 +00:00
Beniamino Galvani
b2635d3461 platform: assert that we only generate route message of tracked proto 2024-08-06 10:15:56 +00:00
Beniamino Galvani
f6411ed941 platform: dump only selected route protocols
When doing a dump of routes, we want to exclude routes having
protocols we do not care about. Since the netlink socket has
STRICT_CHK enabled, we can request multiple dumps for the protocols we
need.

While doing 6 dumps is less efficient than doing 1, it normally
doesn't matter. However, the new implementation is more efficient when
there are e.g. millions of BGP routes that can be excluded from the
results.
2024-08-06 10:15:56 +00:00
Beniamino Galvani
c0ac920f9c platform: introduce array of tracked protocols
Introduce an array of tracked route protocols that will be used in the
next commit. To have the list of protocols defined in a single place,
define a macro.
2024-08-06 10:15:56 +00:00