Commit graph

32532 commits

Author SHA1 Message Date
Jan Vaclav
e69b8149af main: use _nm_utils_ascii_str_to_int64 instead of strtol for reading pid
Also removes the errno check, since it's already done within _nm_utils_ascii_str_to_int64()

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1727
(cherry picked from commit 50f34217f9)
2023-10-03 15:08:20 +02:00
Jan Vaclav
a25e6a27a5 main: don't limit upper bound of pid when checking pidfile
This commit removes the upper bound check for the PID, letting NetworkManager recognize a PID from the pidfile higher than 2^16.
The PID limit is often set higher than 2^16 (65536) on 64-bit systems, resulting in the pidfile being ignored and subsequently deleted if the currently running instance of NetworkManager has a pid higher than 2^16.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1727
(cherry picked from commit 28f7a6638f)
2023-10-03 15:08:19 +02:00
Íñigo Huguet
7db3524407 contrib: add libpsl-dev to debian requirements
It's installed for Fedora and Alpine, and building with meson requires
it by default.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1723
(cherry picked from commit 510952b036)
2023-10-03 15:06:00 +02:00
Fernando Fernandez Mancera
cd099ea0f0 l3cfg: merge branch 'bg/dad-failure-log-rh2123212'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1710

(cherry picked from commit 9fab55ad4c)
2023-10-03 15:03:29 +02:00
Beniamino Galvani
fde965555c l3cfg: demote logging level for ACD conflict messages
NMDevice is now emitting those logs at info level.

(cherry picked from commit 68dc2d3ca9)
2023-10-03 15:03:28 +02:00
Beniamino Galvani
8a91b7beb4 device: log ACD conflicts
l3cfg emits a log for ACD conflicts. However, l3cfg is not aware of
what are the related NMDevice or the currently active connection, and
so it can't log the proper metadata fields (NM_DEVICE and
NM_CONNECTION) to the journal.

Instead, let NMDevice log about ACD collisions; in this way, it is
possible to get the message when filtering by device and connection.
For example:

 $ journalctl -e NM_CONNECTION=d1df47be-721f-472d-a1bf-51815ac7ec3d + NM_DEVICE=veth0
 <info> device (veth0): IP address 172.25.42.1 cannot be configured because it is already in use in the network by host 00:99:88:77:66:55
 <info> device (veth0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
 <warn> device (veth0): Activation: failed for connection 'veth0+'

(cherry picked from commit 9143c1b542)
2023-10-03 15:03:28 +02:00
Beniamino Galvani
287252414b l3cfg: return the conflicting MAC address with ACD events
When a collision is detected by the Address Conflict Detection
mechanism, store the conflicting MAC address in NML3AcdAddrInfo, so
that it is available to listeners of NML3Cfg for events of type
NM_L3_CONFIG_NOTIFY_TYPE_ACD_EVENT.

(cherry picked from commit db307e69cb)
2023-10-03 15:03:28 +02:00
Fernando Fernandez Mancera
5800dd847f man: update default carrier-wait-timeout in NetworkManager.conf
The default value was updated to 6 seconds in
156344b8be.

(cherry picked from commit 4b78778e8b)
2023-10-03 14:55:10 +02:00
Íñigo Huguet
90640673d6 nm-settings-nmcli: show proper valid values of ip-tunnel properties
Show all valid properties for ip-tunnel.mode, not only 2 examples.

Show constants as values suitable for user input in nmcli. That means
showing, for example, "ipip (1)" instead of "IP_TUNNEL_MODE_IPIP (1)".

(cherry picked from commit 140abc81ec)
2023-10-03 14:54:20 +02:00
Frederic Martinsons
e0f1fc0418 devices/wwan: don't assert on unexpected state
On very particular timing, if a connection is currently activating
on a modem device and user remove the remote settings associated
an device state change:

prepare -> deactivating (reason 'connection-removed', sys-iface-state: 'managed')

pops before entering into modem_prepare_result, resulting to a crash
on assertion.

We can simply check for the modem state to failed, set the success flag
to FALSE and continue.

Closes: https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1354

Signed-off-by: Frederic Martinsons <frederic.martinsons@unabiz.com>
(cherry picked from commit 2d85b11660)
2023-10-03 14:53:52 +02:00
Mohammed Sadiq
cef00ac0f7 libnmc-base/utils: Improve qr code bottom border
The bottom border of the generated QR code had a different thickness
compared to other borders.

Improve it by using Upper Half Block so that all borders have similar
thickness.

(cherry picked from commit d9b06a95c9)
2023-10-03 14:53:25 +02:00
Beniamino Galvani
885bc80d29 merge: branch 'bg/ifcfg-migration-readme'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1714

(cherry picked from commit 5ca7d8dbb7)
2023-10-03 14:41:37 +02:00
Beniamino Galvani
c3ae445233 contrib/rpm: add note about interface renaming with ifcfg vs keyfile
(cherry picked from commit cb4c8c2147)
2023-10-03 14:41:37 +02:00
Beniamino Galvani
24cf0a4590 contrib/rpm: ship a different readme when ifcfg migration is enabled
Ship a different file in /etc/sysconfig/network-scripts to warn that
migration is enabled.

(cherry picked from commit c3ca0b90cd)
2023-10-03 14:41:37 +02:00
Sicelo A. Mhlongo
4fbd70c50a wwan/ofono: handle missing default gateway
It is normal for the operator to not provide a default gateway address, in
which case it must be set to 0.0.0.0, as can be seen in upstream ofono test
scripts [1].

[1] https://git.kernel.org/pub/scm/network/ofono/ofono.git/commit/test/process-context-settings?id=945a621a2ddfc01b8bdd8936044cb7d2604e8608

Fixes: a6e81af87f ('wwan: add support for using oFono as a modem manager')
(cherry picked from commit 96ae8b794f)
2023-10-03 14:32:00 +02:00
Wen Liang
fc65b8ff45 device: negate the condition in _get_maybe_ipv6_disabled
The condition in `_get_maybe_ipv6_disabled()` is improperly set which
returns the wrong value on if an device is disabled or not when
generating the assume connection. And when
`/proc/sys/net/ipv6/conf/$DEV/disable_ipv6` is not existed (not
disabling ipv6 through sysctl setting), IPv6 is disabled by default.

Fixes: be655e6ed1 ('core: read "disable_ipv6" sysctl before nm_ip6_config_create_setting()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1743
(cherry picked from commit ffc377ecc6)
2023-10-03 14:31:48 +02:00
Beniamino Galvani
1a1b26c3fe merge: branch 'bg/l3cfg-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1712

(cherry picked from commit 3821df2188)
2023-09-04 18:28:40 +02:00
Beniamino Galvani
c5ad1dbd59 l3cfg: remove tna_dirty member
The member is no longer used.

Fixes: 1feaf427d2 ('platform: rework handling of failed routes during nm_platform_ip_route_sync()')
(cherry picked from commit aed21d50af)
2023-09-04 18:28:40 +02:00
Beniamino Galvani
376948892c l3cfg: fix typo in variable name
Replace "mesc" with "msec".

Fixes: 1feaf427d2 ('platform: rework handling of failed routes during nm_platform_ip_route_sync()')
(cherry picked from commit 3fb1c4dc23)
2023-09-04 18:28:40 +02:00
Beniamino Galvani
cd740f57ce l3cfg: fix log message
nm_utils_addr_family_to_char() requires a valid address family.

Fixes: 1feaf427d2 ('platform: rework handling of failed routes during nm_platform_ip_route_sync()')
(cherry picked from commit 8da4d088ba)
2023-09-04 18:28:40 +02:00
Gris Ge
e5600d4c5a checkpoint: Fix segfault crash when rollback
When rolling back a checkpoint, NM will crash due to dereference a NULL
pointer of `priv->removed_devices->len`.

To fix it, we just place a NULL check before that code block.

Fixes: 1f1b71ad9f ('checkpoint: preserve devices that were removed and
                      readded')

Reference: https://issues.redhat.com/browse/RHEL-1526

Signed-off-by: Gris Ge <fge@redhat.com>
(cherry picked from commit 3162507d6c)
2023-08-29 23:52:10 +02:00
Wen Liang
0e27e84247 nm-manager: ensure device is exported on D-Bus in authentication request
The device authentication request is an async process, it can not know
the answer right away, it is not guarantee that device is still
exported on D-Bus when authentication finishes. Thus, do not return
SUCCESS and abort the authentication request when device is not alive.

https://bugzilla.redhat.com/show_bug.cgi?id=2210271
(cherry picked from commit b341161e2a)
2023-08-23 16:10:34 +02:00
Beniamino Galvani
5c1cb5d3b1 release: bump version to 1.44.1 (development) 2023-08-09 17:52:19 +02:00
Beniamino Galvani
d56e49a4ec release: bump version to 1.44.0 2023-08-09 17:52:19 +02:00
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