Commit graph

32508 commits

Author SHA1 Message Date
Fernando Fernandez Mancera
4dc85ffa5c NEWS: update
(cherry picked from commit a1f48355de)
2023-08-09 17:19:58 +02:00
Fernando Fernandez Mancera
7d0065062c NEWS: update
(cherry picked from commit 52999c0709)
2023-08-09 16:53:35 +02:00
Íñigo Huguet
28e53fed89 nmcli: warn if daemon version mismatch
When updating NetworkManager to a new version, normally the service is
not restarted by the installer to avoid interrupting networking.
However, next nmcli invocation will use the updated version, but against
the older version of the daemon that is still running. Although this is
suposed to work, it is advisable that nmcli and daemon's versions are
the same. Emit a warning recommending restarting the daemon.

Add nmcli test to check the new feature. To avoid breaking the existing
tests, test-networkmanager-service now reports the same version than the
running nmcli except if it's instructed to report a different one.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1703
(cherry picked from commit fb851f3294)
2023-08-09 16:40:54 +02:00
Beniamino Galvani
49c7565a69 merge: branch 'bg/checkpoint-deleted-device'
https://bugzilla.redhat.com/show_bug.cgi?id=2177590
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1708

(cherry picked from commit b3a9999894)
2023-08-09 16:13:09 +02:00
Beniamino Galvani
8a881e638f checkpoint: fetch new device on rollback
When a device belonging to a checkpoint is removed, we clear the
device pointer from the DeviceCheckpoint and move the object from the
devices list to the removed-devices list of the checkpoint.

Later, when restoring the connection we need to set again the device
pointer in DeviceCheckpoint; otherwise, any connection on that device
can't be reactivated if changed.

Fixes: 0e2f7ac7b5 ('nm-checkpoint: drop reference to NM_DEVICE objects on removal signal')
(cherry picked from commit b80a398306)
2023-08-09 16:13:09 +02:00
Beniamino Galvani
1f1b71ad9f checkpoint: preserve devices that were removed and readded
With flag DISCONNECT_NEW_DEVICES, on rollback we delete devices that
are present in the system and are not in the checkpoint.

The problem is that we remove the device from
`NMCheckpointPriv->devices` when it is deleted and so we lose the
information that the device was in the checkpoint. We need to also
look in the `removed_devices` list.

Fixes: 0e2f7ac7b5 ('nm-checkpoint: drop reference to NM_DEVICE objects on removal signal')
(cherry picked from commit 0fcfd6e24f)
2023-08-09 16:13:09 +02:00
Íñigo Huguet
69f58fcb01 gitignore: ignore VSCode project and clangd cache folders
(cherry picked from commit cea9d4634f)
2023-07-29 15:01:56 +02:00
Thomas Haller
c96459a0ee man: fix typo in "NetworkManager.conf" manual
(cherry picked from commit ad6064e4e8)
2023-07-29 15:01:40 +02:00
Thomas Haller
634ac2897d man: clarify relation of "dns.systemd-resolved" setting with "dns"
(cherry picked from commit bba0d553b1)
2023-07-29 15:01:36 +02:00
Beniamino Galvani
7b3a61c8e8 release: bump version to 1.43.90 (1.44-rc1) 2023-07-26 16:49:37 +02:00
Beniamino Galvani
c13b475cb9 NEWS: update 2023-07-26 15:36:01 +02:00
Fernando Fernandez Mancera
7b33aa15d5 device: delete software device when lose carrier and is controller
Software devices that are controllers like bond/bridge/team when
configured to not ignore carrier are being deleted when deactivating the
device. Software devices that are not controllers, shouldn't be deleted.

Otherwise, if a VLAN link is deleted because the ethernet carrier-change
then NetworkManager won't be able to reactivate the VLAN once the
ethernet gets carrier because the link is not present.

This is restoring the previous behaviour and it's know to be relied on
by users.

https://bugzilla.redhat.com/show_bug.cgi?id=2224479

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

Fixes: efa63aef3a ('device: delete software device when software devices lose carrier')
2023-07-26 09:30:39 +02:00
Fernando Fernandez Mancera
9f01cff04f settings: merge branch 'bg/ifcfg-migrate-option'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1700
2023-07-25 15:40:02 +02:00
Beniamino Galvani
b2ada6d4fa settings: implement ifcfg-rh migration option
Implement the migration of ifcfg-rh profiles when the
"main.migrate-ifcfg-rh" option is enabled.
2023-07-25 15:39:06 +02:00
Beniamino Galvani
5e75f0c197 settings: move warning about ifcfg-rh
Move the warning about the presence of ifcfg-rh profiles from the
plugin to NMSettings. In this way, it will be easier to implement the
migration option in the next commit.
2023-07-25 15:39:06 +02:00
Beniamino Galvani
52cca91dd2 build,core: add a "main.migrate-ifcfg-rh" configuration option
The option enables automatic migration of ifcfg-rh connection profiles
to keyfile. The default value can be configured at build time.
2023-07-25 15:39:06 +02:00
Fernando Fernandez Mancera
aaaf727b97 nmtui: merge branch 'jv/nmtui-inclusive'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1698
2023-07-25 14:23:53 +02:00
Jan Vaclav
bf4d0eba6e nmtui: replace occurrences of master/slave with controller/port in internal code
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1335
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1698
2023-07-25 14:22:25 +02:00
Fernando Fernandez Mancera
4f84ed9c10 nmcli: merge branch 'jv/nmcli-inclusive'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1697
2023-07-25 14:19:35 +02:00
Jan Vaclav
16f3e64307 nmcli: replace occurrences of master/slave with controller/port in internal code
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1334
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1697
2023-07-25 14:18:22 +02:00
Wen Liang
e8a2306afb assume: change IPv6 method from "ignore" and "disabled" into "auto"
IPv6 method "disabled" and "ignore" are not supported for loopback
device, when generating the assume connection, the generated connection
will fail verification. Therefore, change the IPv6 method into "auto",
as a result, for loopback external connection, NM will not toggle the
`disable_ipv6` sysctl setting when `systemd-sysctl` sets it into 1.

https://bugzilla.redhat.com/show_bug.cgi?id=2207878

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1694
2023-07-24 22:09:43 -04:00
Jan Vaclav
c779c22fcb initrd: unset dhcp options for static profiles
Makes it so that DHCP properties (`dhcp-timeout`, `dhcp-hostname`) are unset when they are deemed unnecessary.
Unit tests have also been updated to account for this change.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1276
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1695
2023-07-24 11:17:27 +02:00
NorwayFun
13d4d4c35c Update file ka.po
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1687
2023-07-19 14:34:50 +02:00
Fernando Fernandez Mancera
fb362e0583 manager: allow controller activation if device is deactivating
When activating a port connection it will require the controller
connection is active or a valid controller device candidate is available
for activation.

One of the conditions we consider for a controller device to be a valid
candidate for the connection is that it is not active, therefore we
should also consider as valid a device that is currently deactivating.
Otherwise, we could fail during the port activation just because the
deactivation of the controller device candidate didn't finish yet.

https://bugzilla.redhat.com/show_bug.cgi?id=2125615

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1693
2023-07-19 12:09:09 +02:00
Fernando Fernandez Mancera
d441f846b2 glib-aux: merge branch 'th/fix-ifname-valid-kernel'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1692
2023-07-19 11:55:08 +02:00
Thomas Haller
ab69d430a7 glib-aux: fix rejecting '\v' and NBSP in nm_utils_ifname_valid_kernel()
Kernel's dev_valid_name() calls isspace(), which also rejects '\v'
and '\240'.

As this tightens the check, the change can break code that partly worked
before. It surely didn't work to the point, where an interface with such
name could be created in kernel.

  # ip link add name $'foo\240bar' type dummy
  RTNETLINK answers: Invalid argument
2023-07-19 11:50:04 +02:00
Thomas Haller
cffca6f995 glib-aux: add NM_ASCII_SPACES_KERNEL helper 2023-07-19 11:50:04 +02:00
Fernando Fernandez Mancera
5e67644f96 nmcli: merge branch 'ihuguet_ask_offline'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1688
2023-07-17 13:13:17 +02:00
Íñigo Huguet
d414265ab1 nmcli: fix endless loop with --offline --ask
If --offline and --ask were used at the same time, and endless loop
showing the readline's prompt but without waiting for user's input
happened.

This was because when using --offline, all arguments are parsed and
resolved before running the g_main_loop. In nmc_readline_helper it was
checked that the main loop is running, so if g_main_loop_quit is called
we can stop waiting for user's input.

Fix this bug by continue polling for user input if the main loop is
running or if we are in offline mode.  Cancelling the user input is
still possible both in normal and offline mode with Ctrl+C or Ctrl+D.

Added a test case to verify that this still works after future changes.
2023-07-17 12:58:07 +02:00
Íñigo Huguet
5490604084 nmcli: move offline flag from NmCli to NmcConfig struct
This flag is a setting that changes the behaviour of nmcli, it's not
only the current state of the program, so it makes more sense to put it
in NmcConfig than in NmCli.

Furthermore, it's needed to fix a bug in next commit, too.
2023-07-17 12:56:03 +02:00
Thomas Haller
514e944da3
contrib: add "cloud-init", "firewalld", "nftables" to makerepo.sh script 2023-07-14 09:40:26 +02:00
Beniamino Galvani
a81de2fc8b release: bump version to 1.43.11 (development) 2023-07-12 16:56:31 +02:00
Beniamino Galvani
2d261ec768 merge: branch 'fix_ovs'
device: do not set MAC address on iface with index <=0

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1691
2023-07-12 14:43:25 +00:00
Gris Ge
215bc15255 device: do not set MAC address on iface with index <=0
The `nm_device_hw_addr_reset()` should only set MAC address on NIC
with valid(>0) interface index.

The failure was found by `ovs_mtu` test of NMCI, failed to reproduce
the original problem (`ovs_mtu` test of NMCI) with 100 times retry.
And no trace log found for original test failure, hence cannot tell why
`nm_device_hw_addr_reset()` been invoked with iface index 0.

Signed-off-by: Gris Ge <fge@redhat.com>
2023-07-12 22:16:04 +08:00
Thomas Haller
efa63aef3a device: delete software device when software devices lose carrier
We delete devices when the connection goes down and NetworkManager
created the device earlier.

Software devices like bond/bridge/team default to ignoring carrier.
However, when configuring them to not ignore carrier
([device].ignore-carrier), they were not deleted when deactivating the
devices.

This adjusts commit d0c2a24b71 ('device: do not remove software devices
on initial disconnected (rh #1035814)'). Note that back then there was
no check whether the device has an activation queued, so it behaved
differently then.

When the software device enters the UNAVAILABLE state from UNMANAGED,
during cleanup we shouldn't delete the link.

Co-Authored-By: Beniamino Galvani <bgalvani@redhat.com>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1686
2023-07-12 15:30:05 +02:00
Jan Vaclav
9a5c7c7228 build: make modprobe path configurable
Extracts the hardcoded modprobe path used in `src/libnm-platform/nm-platform-utils.c` to the configurable MODPROBE_PATH macro
Merge request: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1689
Closes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1257
2023-07-11 17:06:19 +02:00
Fernando Fernandez Mancera
5b8fdd25ab utils: extend connection matching function for UUID in controller
When matching two connections one might be using UUID and the other one
could be using interface-name for the controller property. When
recovering from a fresh start NM does not have any context and when
generating a connection we are using UUID as the controller.

It is always hard to guess what is the right candidate to pick but at
least something NM can do is checking if the UUID matches a connection
with the same controller interface-name. If there are no other
conflicts, then we can assume that is a good canditate to activate.

This is a follow up to `dc254f90e2b306700a0b81f7194e9b0438c62f4c`.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1684
2023-07-11 17:01:41 +02:00
Gris Ge
5565aebf30 merge: branch 'br_fix_po'
po: fix wrong translation in simplified Chinese

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1590
2023-07-03 09:32:22 +00:00
chengyechun
11219b483a po: fix wrong translation in simplified Chinese 2023-07-03 09:16:44 +00:00
Thomas Haller
ccb16013e0
gitlab-ci: fix detection and handling of Ubuntu 18.04
Fixes: d563b4e009 ('gitlab-ci: fix setup of debian:9 container')
2023-06-30 18:51:13 +02:00
Thomas Haller
6985c011c7
nm-in-container: add NetworkManager.service override 2023-06-30 15:44:05 +02:00
Thomas Haller
ad4e068bfd
cloud-setup/man: add DEBUGGING section to man nm-cloud-setup 2023-06-29 17:41:13 +02:00
Beniamino Galvani
646e041523 dns: fix tracking of best ip config
When a IP configuration has type "best", it is the configuration with
the best (lowest) metric default route for the specific address
family. Therefore, there can be only one best configuration for
address family.

When a new configuration is added as best, make sure it is the only
one for the address family.

This reverts commit 0abc14b3a0.

Fixes: 0abc14b3a0 ('core: remove unused best_ip_config_[46] field in NMDnsManager')

https://lists.freedesktop.org/archives/networkmanager/2023-June/000123.html
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1331
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1683
2023-06-29 15:12:51 +02:00
Thomas Haller
c961ec1f99
keyfile: merge branch 'th/keyfile-rename'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1661
2023-06-29 14:10:12 +02:00
Thomas Haller
e9426e6d07
keyfile: add a NetworkManager.conf option "keyfile.rename"
The default behavior is not to rename profiles. I guess, that makes
sense, as renaming a file when changing the "connection.id" could break
users who rely on the name.

My use case is the following. When I connect a Wi-Fi hotspot I use
`nmcli device wifi connect $SSID`, which -- as expected -- persists the
profile to "/etc/NetworkManager/system-connections/$SSID.nmconnection".
Later, I always update the profile's name to "w_$SSID" so I can see on
the name that this is wireless profile. I also want the filename to
reflect that change of name.

Add a configuration option for that. All the infrastructure
("force_rename" parameter) already exists.
2023-06-29 14:05:27 +02:00
Thomas Haller
c1f2616618
keyfile: add option to nms_keyfile_writer_connection() to follow the preferred name
There was already a force_rename argument to nms_keyfile_writer_connection(), which
-- if TRUE -- means to always rename the file, if it exists.

What we also want, is to follow the change of a connection.id. So we don't want
to force a rename, if we already use the preferred name, but we also want to rename
otherwise.

Extend the boolean "force_rename" argument to a NMTernary, where NM_TERNARY_DEFAULT
now means to follow the preferred name.
2023-06-29 14:05:27 +02:00
Thomas Haller
cfe2cede12
core/settings: fix "force_rename" for writing connection to disk
"force_rename" parameter was not used previously, but it also was broken.
Fix it. We need to create a new NMSettingsStorage instance when the filename
changes, as the storage's filename is immutable.
2023-06-29 14:05:27 +02:00
Thomas Haller
3d2622c358
settings: fix passing force_rename flag to _update_connection_to_plugin()
No bad effects so far, it was unused.

But as it wasn't used, also no longer set the update_reason flag
NM_SETTINGS_CONNECTION_UPDATE_REASON_FORCE_RENAME. We didn't have the
force-rename behavior so far. This makes the flag totally unused, and
maybe should be dropped. It's kept for now, if only to show what could
be done.
2023-06-29 14:05:27 +02:00
Thomas Haller
e5a6e16ce0
keyfile/tests: rename internal test-only function to have nmtst prefix
We have some interal code that is only used to expose functionality for
the tests. Those functions should be easily distinguishable from code
that is used by the "real" code. Give a "nmtst" prefix. Rename
nms_keyfile_writer_test_connection() to nmtst_keyfile_writer_test_connection().
2023-06-29 14:05:27 +02:00
Gris Ge
c6b5dc2552 merge: branch 'sriov_opt'
sriov: do not fail activation on SR-IOV VF failures

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1682
2023-06-29 10:07:14 +00:00