Commit graph

32543 commits

Author SHA1 Message Date
Fernando Fernandez Mancera
4b78778e8b man: update default carrier-wait-timeout in NetworkManager.conf
The default value was updated to 6 seconds in
156344b8be.
2023-08-30 17:20:33 +02:00
Gris Ge
3162507d6c 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>
2023-08-29 23:50:18 +02:00
Fernando Fernandez Mancera
194b381d38 manager: merge branch 'wl/device_auth_request_fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1716
2023-08-23 16:00:43 +02:00
Wen Liang
b341161e2a 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
2023-08-22 12:17:16 -04:00
Wen Liang
52e9600f03 Revert "nm-policy: stop rechecking autoactivation if device is unregistered"
When we register the auto-activate, the device has to be registered in
NMPolicy, the assertion is correct and ensure that.

This reverts commit 712729f652.
2023-08-22 11:46:46 -04:00
Thomas Haller
f55f848833
libnm: chain up "constructed() method in NMAuthSubject
It's not strictly necessary, because GObject.constructed() is
intentionally a NOP, to optionally allow chaining the parent method.

However, for consistency, this is what we commonly do.
2023-08-22 16:45:43 +02:00
Wen Liang
712729f652 nm-policy: stop rechecking autoactivation if device is unregistered
If the device is no longer registered to NMPolicy,
`g_signal_handler_find()` can not find the signal handler that was
disconnected before, therefore, there is no need to schedule a check for
autoactivation.

https://bugzilla.redhat.com/show_bug.cgi?id=2210271
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1711
2023-08-17 07:23:51 -04:00
Fernando Fernandez Mancera
9fab55ad4c l3cfg: merge branch 'bg/dad-failure-log-rh2123212'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1710
2023-08-14 12:39:52 +02:00
Beniamino Galvani
68dc2d3ca9 l3cfg: demote logging level for ACD conflict messages
NMDevice is now emitting those logs at info level.
2023-08-11 13:30:38 +02:00
Beniamino Galvani
9143c1b542 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+'
2023-08-11 13:30:38 +02:00
Beniamino Galvani
db307e69cb 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.
2023-08-11 13:30:38 +02:00
Beniamino Galvani
995539cd30 contrib/rpm: enable ifcfg migration on Fedora 39+
https://fedoraproject.org/wiki/Changes/MigrateIfcfgToKeyfile
2023-08-10 13:21:49 +02:00
Beniamino Galvani
3f220e7dc5 release: bump version to 1.45.1 (development) 2023-08-09 18:05:00 +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
a1f48355de NEWS: update 2023-08-09 17:19:30 +02:00
Fernando Fernandez Mancera
7d0065062c NEWS: update
(cherry picked from commit 52999c0709)
2023-08-09 16:53:35 +02:00
Fernando Fernandez Mancera
52999c0709 NEWS: update 2023-08-09 16:52:18 +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
Beniamino Galvani
b3a9999894 merge: branch 'bg/checkpoint-deleted-device'
https://bugzilla.redhat.com/show_bug.cgi?id=2177590
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1708
2023-08-09 16:10:57 +02:00
Beniamino Galvani
b80a398306 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')
2023-08-09 16:10:22 +02:00
Beniamino Galvani
0fcfd6e24f 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')
2023-08-09 16:10:22 +02:00
Thomas Haller
f930c76a0a
merge branch 'th/signedness-check-minmax'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1702
2023-08-07 15:12:08 +02:00
Thomas Haller
5fe6b63a62
std-aux: add static-asserts about signedness for NM_CMP_DIRECT() 2023-08-07 09:24:47 +02:00
Thomas Haller
f27bf0b9ea
std-aux: add static-asserts about signedness of NM_MIN()/NM_MAX()/NM_CLAMP()
The macros NM_MIN()/NM_MAX()/NM_CLAMP() use typeof() to accept any
integer type as argument. Internally, they rely on standard C integral
conversions of the <> operators and the ternary operator for evaluating
the comparison and the result(type).

That works mostly great. Except, comparing signed and unsigned values in
C leads to oddities and the caller should explicitly take care of that.

Add static assertions to check that the compared arguments have the same
signedness.
2023-08-07 09:24:47 +02:00
Thomas Haller
3732f08319
std-aux: add _NM_INT_IS_SIGNED() and _NM_INT_SAME_SIGNEDNESS() macros 2023-08-07 09:24:46 +02:00
Thomas Haller
5ff1468717
all: ensure signendess for arguments of NM_{MIN,MAX,CLAMP}() macros matches 2023-08-07 09:24:36 +02:00
Íñigo Huguet
fb851f3294 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
2023-08-03 10:09:06 +02:00
Fernando Fernandez Mancera
1dff015627 wifi: merge branch 'ff/wifi_bandwidth'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1704
2023-08-02 10:26:51 +02:00
Fernando Fernandez Mancera
2115032869 nmcli: show bandwidth on wifi device output
Example output:

```
NAME:                                   AP[3]
SSID:                                   testX
SSID-HEX:                               4D4F5649535441525F504C55535F32453037
BSSID:                                  80:78:71:90:2E:15
MODE:                                   Infra
CHAN:                                   104
FREQ:                                   5520 MHz
RATE:                                   540 Mbit/s
BANDWIDTH:                              40 MHz
SIGNAL:                                 32
BARS:                                   ▂▄__
SECURITY:                               WPA2
WPA-FLAGS:                              (none)
RSN-FLAGS:                              pair_ccmp group_ccmp psk
DEVICE:                                 wlp0s20f3
ACTIVE:                                 yes
IN-USE:                                 *
DBUS-PATH:                              /org/freedesktop/NetworkManager/AccessPoint/3
```
2023-08-02 00:54:32 +02:00
Fernando Fernandez Mancera
fe48a4b35c wifi: parse access point announced bandwidth
Parse the access point announced bandwidth in MHz. This is considering
both HT and VHT. Please notice that for VHT 80+80 MHz we are representing it
as 160 MHz.
2023-08-02 00:54:27 +02:00
Fernando Fernandez Mancera
d3620dd286 version: add version 1.46 macros 2023-08-01 19:25:58 +02:00
Fernando Fernandez Mancera
a44f20c985 man: adjust references of nm-settings to nm-settings-nmcli
nm-settings was renamed to nm-settings-nmcli therefore we should rename
all the references to nm-settings-nmcli.
2023-08-01 14:21:23 +02:00
Frederic Martinsons
ac327cb855 nmcli: avoid freeing NULL GString and correct error message
Fixes #1362

Signed-off-by: Frederic Martinsons <frederic.martinsons@gmail.com>
2023-07-31 13:01:20 +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
Íñigo Huguet
cea9d4634f gitignore: ignore VSCode project and clangd cache folders 2023-07-28 18:05:32 +02:00
Thomas Haller
ad6064e4e8
man: fix typo in "NetworkManager.conf" manual 2023-07-27 21:37:22 +02:00
Thomas Haller
bba0d553b1
man: clarify relation of "dns.systemd-resolved" setting with "dns" 2023-07-27 21:10:11 +02:00
Beniamino Galvani
401ceb85bc release: bump version to 1.45.0 (development) 2023-07-26 16:54:34 +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