Commit graph

32574 commits

Author SHA1 Message Date
Thomas Haller
fdfecab64f
cli: fix sorting of active connections
CMP() is a confusing pattern. Sure enough, the sort order was wrong, for
example, `nmcli connection` would show

    $ nmcli -f STATE,UUID,DEVICE c
    STATE       UUID                                  DEVICE
    activating  3098c902-c59c-45f4-9e5a-e4cdb79cfe1b  nm-bond
    activated   e4fc23ac-54ab-4b1a-932a-ebed12c96d9b  eth1

("activating" shown before "activated").

With `nmcli device`, we sort with compare_devices(). This first sorts by
device state (with "connected" being sorted first). Only when the device
state is equal, we fallback to nmc_active_connection_cmp().  So with
`nmcli device` we usually get "connected" devices first, and we don't
really notice that there is a problem with nmc_active_connection_cmp().

On the other hand, `nmcli connection` likes to sort first via
nmc_active_connection_cmp(), which gets it wrong. Profiles in
"activating" state are sorted first. That's inconsistent with `nmcli
device`, but it's also not what is intended.

Fix that.

Note the change in the test output. Both eth1 and eth0 are connected to
to the same profile, but one "eth0" the active-connection's state is
DEACTIVATING, while on "eth1" it's ACTIVATED (but both device's states
are "CONNECTED"). That's why "eth1" is now sorted first (as desired).

Fixes: a1b25a47b0 ('cli: rework printing of `nmcli connection` for multiple active connections')
(cherry picked from commit 8e1330964d)
2023-11-21 09:22:13 +01:00
Thomas Haller
4d0465e997
client/tests: add checks to "test-client.py"
- test for "-order" option with `nmcli connection show`.

- test for order of activated devices. Optimally, the devices
  should be in activating vs. activated state. I fail to do that,
  the mock implementation is cumbersome to use. It still seems useful
  to have this (maybe it could be improved).

(cherry picked from commit ca5fb29b7e)
2023-11-21 09:22:03 +01:00
Beniamino Galvani
438fe7c729 merge: branch 'jv/ipv6-acd-logging'
device: add IPv6 ACD logging for ac6/manual configuration

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

(cherry picked from commit 8d2e510065)
2023-11-21 09:16:18 +01:00
Jan Vaclav
b7f256e12e ndisc: remove redundant DAD logging
The log message here is not needed anymore, as the conflict is
already logged by nm-device.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1787
(cherry picked from commit 94643d7e43)
2023-11-21 09:16:15 +01:00
Jan Vaclav
b0fab8fe09 device: add IPv6 ACD logging for ac6/manual configuration
Adds logging for ACD when IPv6 addresses are configured manually or via AC6.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1787
(cherry picked from commit 856cbbd663)
2023-11-21 09:16:14 +01:00
Beniamino Galvani
5ac0cf76fa l3cfg: fix pruning of ACD data (take 2)
If a commit is invoked without any change to the l3cd or to the ACD
data, in _l3cfg_update_combined_config() we skip calling
_l3_acd_data_add_all(), which should clear the dirty flag from ACDs.
Therefore, in case of such no-op commits the ACDs still marked as
dirty - but valid - are removed via:

 _l3_commit()
   _l3_acd_data_process_changes()
     _l3_acd_data_prune()
       _l3_acd_data_prune_one()

Invoking a l3cfg commit without any actual changes is allowed, see the
explanation in commit e773559d9d ('device: schedule an idle commit
when setting device's sys-iface-state').

The bug is visible by running test 'bond_addreses_restart_persistence'
with IPv4 ACD/DAD is enabled by default: after restart IPv6 completes
immediately, the devices becomes ACTIVATED, the sys-iface-state
transitions from ASSUME to MANAGED, a commit is done, and it
incorrectly prunes the ACD data. The result is that the IPv4 address
is never added again.

Fix this by doing the pruning only when we update the dirty flags.

This is a respin of commit ed565f9146 ('l3cfg: fix pruning of ACD
data') that was reverted because it was causing a crash. The crash was
caused by unconditionally clearing `acd_data_pruning_needed` in
_l3cfg_update_combined_config(), while we need to do it only when
actually committing the configuration.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1749
(cherry picked from commit 5b16c128bb)
2023-11-21 09:13:14 +01:00
Jan Vaclav
e4c583e333 device: fix assertion failure caused by DAD array reuse
This commit fixes an assertion failure caused by the `conflicts` array being reused
when both IPv4 and IPv6 duplicate address detection occurs.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1747
Fixes: afa208c862 ('core: return conflicting addresses from nm_l3cfg_check_ready()')
(cherry picked from commit aa84b5f935)
2023-11-21 09:13:10 +01:00
Beniamino Galvani
2449f29e45 Revert "l3cfg: fix pruning of ACD data"
The commit causes the following assertion failure:

  0  0x00007f4187e22884 in __pthread_kill_implementation () from target:/lib64/libc.so.6
  1  0x00007f4187dd1afe in raise () from target:/lib64/libc.so.6
  2  0x00007f4187dba87f in abort () from target:/lib64/libc.so.6
  3  0x00007f4188386f4e in g_assertion_message (domain=domain@entry=0x6fc1bc "nm", file=file@entry=0x722e94 "../src/core/nm-l3cfg.c", line=line@entry=2134,
     func=func@entry=0x727730 <__func__.49> "_l3_acd_data_add_all", message=message@entry=0x23b3bb0 "assertion failed: (acd_data->info.track_infos[i]._priv.acd_dirty_track)")
     at ../glib/gtestutils.c:3450
  4  0x00007f41883f1597 in g_assertion_message_expr (domain=domain@entry=0x6fc1bc "nm", file=file@entry=0x722e94 "../src/core/nm-l3cfg.c", line=line@entry=2134,
     func=func@entry=0x727730 <__func__.49> "_l3_acd_data_add_all", expr=expr@entry=0x726450 "acd_data->info.track_infos[i]._priv.acd_dirty_track") at ../glib/gtestutils.c:3476
  5  0x0000000000587209 in _l3_acd_data_add_all (self=self@entry=0x23a7020, infos=infos@entry=0x0, infos_len=infos_len@entry=0, reapply=reapply@entry=1)
     at ../src/core/nm-l3cfg.c:2134
  6  0x0000000000587702 in _l3cfg_update_combined_config (self=self@entry=0x23a7020, to_commit=to_commit@entry=1, reapply=reapply@entry=1, out_old=out_old@entry=0x7ffd09ea4ca8,
     out_changed_combined_l3cd=out_changed_combined_l3cd@entry=0x7ffd09ea4c7c) at ../src/core/nm-l3cfg.c:3858
  7  0x000000000058a202 in _l3_commit (self=0x23a7020, commit_type=commit_type@entry=NM_L3_CFG_COMMIT_TYPE_REAPPLY, is_idle=is_idle@entry=0) at ../src/core/nm-l3cfg.c:5046
  8  0x000000000058a49f in nm_l3cfg_commit (self=<optimized out>, commit_type=commit_type@entry=NM_L3_CFG_COMMIT_TYPE_REAPPLY) at ../src/core/nm-l3cfg.c:5115
  9  0x00000000004856cd in nm_device_l3cfg_commit (self=self@entry=0x23ab870, commit_type=commit_type@entry=NM_L3_CFG_COMMIT_TYPE_REAPPLY, commit_sync=commit_sync@entry=1)
     at ../src/core/devices/nm-device.c:4155
  10 0x00000000004b1814 in nm_device_cleanup (self=self@entry=0x23ab870, reason=reason@entry=NM_DEVICE_STATE_REASON_NEW_ACTIVATION,
     cleanup_type=cleanup_type@entry=CLEANUP_TYPE_DECONFIGURE) at ../src/core/devices/nm-device.c:15884
  11 0x00000000004b26c9 in _set_state_full (self=self@entry=0x23ab870, state=state@entry=NM_DEVICE_STATE_DISCONNECTED, reason=NM_DEVICE_STATE_REASON_NEW_ACTIVATION,
     quitting=quitting@entry=0) at ../src/core/devices/nm-device.c:16291
  12 0x00000000004b2fe4 in nm_device_state_changed (self=self@entry=0x23ab870, state=state@entry=NM_DEVICE_STATE_DISCONNECTED, reason=<optimized out>)
     at ../src/core/devices/nm-device.c:16505
  13 0x00000000004b69de in queued_state_set (user_data=user_data@entry=0x23ab870) at ../src/core/devices/nm-device.c:16532
  14 0x00007f41883bf4fd in g_idle_dispatch (source=0x23a88e0, callback=0x4b6956 <queued_state_set>, user_data=0x23ab870) at ../glib/gmain.c:6163
  15 0x00007f41883c34fc in g_main_dispatch (context=0x22c4d10) at ../glib/gmain.c:3460
  16 g_main_context_dispatch (context=0x22c4d10) at ../glib/gmain.c:4200
  17 0x00007f41884216b8 in g_main_context_iterate.isra.0 (context=0x22c4d10, block=1, dispatch=1, self=<optimized out>) at ../glib/gmain.c:4276
  18 0x00007f41883c2aff in g_main_loop_run (loop=0x22c3b50) at ../glib/gmain.c:4479
  19 0x0000000000423a37 in main (argc=<optimized out>, argv=<optimized out>) at ../src/core/main.c:519

This reverts commit ed565f9146.

(cherry picked from commit 6a63d79fe6)
2023-11-21 09:12:54 +01:00
Beniamino Galvani
19c2297685 merge: branch 'bg/ipv4-dad-fixes'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1734
(cherry picked from commit 11c9ce12f4)
2023-11-21 09:12:27 +01:00
Beniamino Galvani
cb3463bbc1 core: don't fail if at least one static address passes DAD
It seems more useful to have a best effort approach and configure
everything we can; in that way we achieve at least some connectivity,
and then sysadmin can check the logs in case something is
missing. Currently instead, the whole activation fails (so, no address
is configured) if just one of the addresses fails DAD.

Ideally, we should have a way to make this configurable; but for now,
implement the more useful behavior as default.

(cherry picked from commit a45024714f)
2023-11-21 09:12:08 +01:00
Beniamino Galvani
3ddd1d6e7b libnm: better document IPv4 DAD property
Clarify that the value is the *maximum* interval; the actual value is
randomized and can be as low as half the specified one.

(cherry picked from commit 536805231a)
2023-11-21 09:11:56 +01:00
Beniamino Galvani
5bf855c7c1 l3cfg: log the reason when marking IP configuration dirty
(cherry picked from commit 6ebf2c6ba1)
2023-11-21 09:11:11 +01:00
Beniamino Galvani
906caf96f5 l3cfg: improve logging
- avoid "update" as it is also a commit type
 - make clear that the commit is not happening now

(cherry picked from commit e83e8b73f4)
2023-11-21 09:11:09 +01:00
Beniamino Galvani
707ddcfaac device: check DAD result for manual method even without carrier
IPv4 and IPv6 DAD work slightly differently: for IPv4 the presence or
absence of carrier doesn't have any effect on the duration of the
probe; for IPv6, DAD never completes without carrier because kernel
never removes the tentative flag.

In both cases, we shouldn't ignore the DAD result because that would
mean that we complete the ipmanual method without addresses actually
configured.

(cherry picked from commit 1f73034719)
2023-11-21 09:11:07 +01:00
Beniamino Galvani
233d89da4b dhcp: don't schedule commit of type "update" when clearing acd
We don't know the reason why the DHCP client is being stopped. It is
wrong to schedule a commit of type "update" because the device could
be now unmanaged. Schedule instead a commit of type "auto", which
automatically determines the type of commit based on registered
handles.

(cherry picked from commit a49913504d)
2023-11-21 09:11:05 +01:00
Beniamino Galvani
b4f0b504d4 l3cfg: fix pruning of ACD data
If a commit is invoked without any change to the l3cd or to the ACD
data, in _l3cfg_update_combined_config() we skip calling
_l3_acd_data_add_all(), which should clear the dirty flag from ACDs.
Therefore, in case of such no-op commits the ACDs still marked as
dirty - but valid - are removed via:

 _l3_commit()
   _l3_acd_data_process_changes()
     _l3_acd_data_prune()
       _l3_acd_data_prune_one()

Invoking a l3cfg commit without any actual changes is allowed, see the
explanation in commit e773559d9d ('device: schedule an idle commit
when setting device's sys-iface-state').

The bug is visible by running test 'bond_addreses_restart_persistence'
with IPv4 ACD/DAD is enabled by default: after restart IPv6 completes
immediately, the devices becomes ACTIVATED, the sys-iface-state
transitions from ASSUME to MANAGED, a commit is done, and it
incorrectly prunes the ACD data. The result is that the IPv4 address
is never added again.

Fix this by doing the pruning only when we update the dirty flags.

(cherry picked from commit ed565f9146)
2023-11-21 09:11:03 +01:00
Beniamino Galvani
ea36338d07 l3cfg: skip ACD for interfaces with IFF_NOARP
Interfaces with IFF_NOARP don't support Address Conflict Detection,
which is based on ARP. Trying to start ACD on them would result in
ENOBUFS always being returned by send(), and n-acd handles such error
by retrying indefinitely.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
(cherry picked from commit 7548ff57d3)
2023-11-21 09:11:02 +01:00
Beniamino Galvani
97792b34e6 l3cfg: schedule a commit when ACD is not supported
On interfaces not supporting ACD (for example, layer3 interfaces), the
probe fails to be created with message:

 l3cfg[...,ifindex=2]: acd[172.25.17.1, init]: probe-good (interface does not support acd, initial post-commit)
 l3cfg[...,ifindex=2]: acd[172.25.17.1, ready]: set state to ready (probe is ready, waiting for address to be configured)

During the post-commit event, if the address is not yet configured, we
need to schedule a new commit to actually add it.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
(cherry picked from commit 687051368f)
2023-11-21 09:11:00 +01:00
Beniamino Galvani
e2a7e9c32f n-acd: use separate seed state for each probe of the same acd
Currently, all the probes of an acd instance share the same seed
state. This means that the state is updated by all the probes, and as
a consequence they get different jitters for the wait timeouts;
therefore the order in which addresses become available (and are
configured on the interface) is not deterministic.

Keep a separate seed state for each probe, initialized from the acd
seed. This ensures that all the probes use the same timeouts when
sending probe requests, and that in case of no collision, addresses
are available in the order of probe start.

n-acd pull request: https://github.com/nettools/n-acd/pull/10

(cherry picked from commit 23727917b2)
2023-11-21 09:10:58 +01:00
Beniamino Galvani
a5bbfe997a device: wait DAD before starting dnsmasq in IPv4 shared mode
Currently, IPv4 shared mode fails to start when DAD is enabled because
dnsmasq tries to bind to an address that is not yet configured on the
interface. Delay the start of dnsmasq until the shared4 l3cd is ready.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
(cherry picked from commit e97ebb2441)
2023-11-21 09:10:56 +01:00
Beniamino Galvani
727e09f74a man: merge branch 'bg/man-license'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1744

(cherry picked from commit 6fa4a45470)
2023-11-21 09:05:47 +01:00
Beniamino Galvani
2e9539ba05 man: improve NM-dispatcher man page
(cherry picked from commit abf41bc282)
2023-11-21 09:05:47 +01:00
Beniamino Galvani
719fa27202 man: replace license blurb with SPDX tag
(cherry picked from commit 7a07a0b92d)
2023-11-21 09:05:46 +01:00
Beniamino Galvani
1ff517e191 docs,m4: remove paragraph about writing to FSF
The Free Software Foundation has changed addresses in the past, and
may do so again. NetworkManager already includes a copy of the
licenses.

(cherry picked from commit 6971d53901)
2023-11-21 09:05:46 +01:00
Beniamino Galvani
6314a69d7f man: remove old version of nmtui man page
The man page is now generated from the docbook xml.

Fixes: 5216307b5a ('man: convert nmtui(1) manual to docbook refentry')
(cherry picked from commit b777cbf5a5)
2023-11-21 09:05:46 +01:00
Thomas Haller
d42f89b8ca
contrib: fix invalid escape sequence in "find-backports"
Fixes: 57cfa5daf9 ('contrib: add "find-backports" script')
(cherry picked from commit 1d241f5295)
2023-11-20 17:15:26 +01:00
Íñigo Huguet
7b00d41233
contrib/rpm: libnm: migrate to SPDX license
The license identifier was updated for the main package, but not for
libnm which overrides it to LGPL 2.1 or later. Update it too.

Fixes: 8c5aec7a1b ('contrib/rpm: migrate to SPDX license')
(cherry picked from commit 1560052dcc)
2023-11-20 17:01:53 +01:00
Beniamino Galvani
e942c4129e
contrib/rpm: enable ifcfg migration on Fedora 39+
https://fedoraproject.org/wiki/Changes/MigrateIfcfgToKeyfile
(cherry picked from commit 995539cd30)
2023-10-30 14:34:14 +01:00
Íñigo Huguet
54908e0ec2
spec: Add missing epoch to some obsoleted versions
An rpm linter has complained with:
Missing epoch prefix on the version-release in 'Obsoletes: NetworkManager < 1.0.0' for NetworkManager-team

(cherry picked from commit 72b2485042)
2023-10-30 14:27:53 +01:00
Beniamino Galvani
ba1988969a merge: branch 'bg/deactivate-reason'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1770
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1405

(cherry picked from commit b0d606b427)
2023-10-27 18:10:03 +02:00
Beniamino Galvani
d14ad5c0ca core: propagate the user-requested reason for act-request disconnection
If the device is being disconnected for a user request, at the moment
the active connection goes to state DEACTIVATED through the following
transitions, independently of the reason for the disconnection:

 - state: DEACTIVATING, reason: UNKNOWN
 - state: DEACTIVATED,  reason: DEVICE_DISCONNECTED

For VPNs, a disconnection is always user-initiated, and the active
connection states emitted are:

 - state: DEACTIVATING, reason: USER_DISCONNECTED
 - state: DEACTIVATED,  reason: USER_DISCONNECTED

This difference poses problems for clients that want to handle device
and VPNs in the same way, especially because WireGuard is implemented
as a device, but is logically a VPN.

Let NMActRequest translate the USER_REQUESTED device state reason to
USER_DISCONNECTED active connection state reason, in case of
disconnection.

This is an API change, but the previous behavior of reporting generic
uninformative reasons seems a bug. See for example
nmc_activation_get_effective_state(), which inspects the AC state
reason and in case it's generic (DEVICE_DISCONNECTED), it considers
the device state instead.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1405
(cherry picked from commit d3db0883c7)
2023-10-27 18:10:03 +02:00
Beniamino Galvani
526a001852 core: add "reason" argument to NMActiveConnection device_state_changed()
NMActiveConnection implements method device_state_changed() that
re-emits device state changes as convenience for subclasses. Add the
reason for the state change to the handler, as it will be used in the
next commit.

(cherry picked from commit 634dd2f5e8)
2023-10-27 18:10:03 +02:00
Gris Ge
366ea0bf32 merge: branch 'nm-1-44'
[nm-1.44] dispatch `dns-change` dispatcher event

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1757
2023-10-18 06:47:27 +00:00
Gris Ge
3cdce71b95 dispatch dns-change dispatcher event
Introducing new dispatcher event -- `dns-change` which will be emitted when
DNS configuration changed(even in `dns=none` mode). This is to solve two
use cases:
 * Invoke dispatch script for DNS changes triggered by the global DNS
   API.

 * Do not invoke [OpenShift resolv-prepender][1] for non-DNS changes.

Bug reference: https://issues.redhat.com/browse/RHEL-1671

[1]: https://github.com/openshift/machine-config-operator/blob/master/templates/common/on-prem/files/resolv-prepender.yaml

Signed-off-by: Gris Ge <fge@redhat.com>
(cherry picked from commit a1db61ebc9)
2023-10-18 14:24:34 +08:00
Gris Ge
d10f20fd01 emit DNS CONFIG_CHANGED signal even dns=none
Instruct the `NMDnsManager` to emit `CONFIG_CHANGED` signal even
`dns=none` or failed to modify `/etc/resolv.conf`.

The `NMPolicy` will only update hostname when DNS is managed.

Signed-off-by: Gris Ge <fge@redhat.com>
(cherry picked from commit a847ba8075)
2023-10-18 14:24:34 +08:00
Beniamino Galvani
57834169d8 release: bump version to 1.44.3 (development) 2023-10-03 16:28:07 +02:00
Beniamino Galvani
8bee6ef894 release: bump version to 1.44.2 2023-10-03 16:28:07 +02:00
Beniamino Galvani
cdd03131bb NEWS: update 2023-10-03 16:00:02 +02:00
Beniamino Galvani
5956b490d9 merge: branch 'th/clicolor-force'
Support CLICOLOR_FORCE variable and fix handling of empty NO_COLOR

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

(cherry picked from commit 673f9d2154)
2023-10-03 15:12:35 +02:00
Thomas Haller
9233df8c5d cli: honor CLICOLOR_FORCE= variable to enable colors with nmcli
Note that [1] suggests to also accept an empty value as having the variable
set. That is likely a bug ([2]) in the documentation, makes little sense, and
is not the case with NO_COLOR ([3]).

[1] https://bixense.com/clicolors/
[2] https://github.com/jhasse/clicolors/issues/13
[3] https://no-color.org/

(cherry picked from commit ae06a607b3)
2023-10-03 15:12:34 +02:00
Thomas Haller
63017f1a3f cli: fix handling empty NO_COLOR= variable
An empty value NO_COLOR= should not be treated to disable colors.
This is also what [1] says (changed a while ago [2]).

[1] https://no-color.org/
[2] 99f90e27d0

(cherry picked from commit 0ac5221c40)
2023-10-03 15:12:34 +02:00
Beniamino Galvani
786766958b merge: branch 'jv/no-pid-upper-bound'
main: increase upper limit of pid when checking pidfile

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

(cherry picked from commit fa1239df14)
2023-10-03 15:08:20 +02:00
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