I've seen this in `NetworkManager-1.34.0-0.3.el8.x86_64` (latest in CentOS
Stream 8 at the time of writing this message) which does not use the latest
Systemd but probably the code base is the same (see
51f93e00a2).
Before the patch:
```
libsystemd: eth0: DHCPv6 client: T1 expires in 34y 3w 6d 45min 31s
libsystemd: eth0: DHCPv6 client: T2 expires in 54y 5month 3w 3d 23h 20min 35s
```
After the patch:
```
libsystemd: eth0: DHCPv6 client: T1 expires in 3d 7h 58min 3s
libsystemd: eth0: DHCPv6 client: T2 expires in 5d 2h 26min 50s
```
same box (x86_64 system) and same DHCPv6 server.
This regression has likely been introduced by 8a8955507af363c31297bbc5df79852db4ad39d6.
See-also: https://github.com/systemd/systemd/pull/21558https://bugzilla.redhat.com/show_bug.cgi?id=2027267https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/863
Fix the following assertion failure:
src/core/nm-l3cfg.c:2636:_l3_acd_data_state_change: assertion failed: (!acd_data->nacd_probe)
When AcdData enters state NM_L3_ACD_ADDR_STATE_READY, the duplicate
address detection procedure completed successfully but the address is
not configured yet on the interface. In the READY state we don't clear
the probe because the same probe can be reused also for defending the
address. Change the assertion.
https://bugzilla.redhat.com/show_bug.cgi?id=2026288https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1035
We use clang-format for automatic formatting of our source files.
Since clang-format is actively maintained software, the actual
formatting depends on the used version of clang-format. That is
unfortunate and painful, but really unavoidable unless clang-format
would be strictly bug-compatible.
So the version that we must use is from the current Fedora release, which
is also tested by our gitlab-ci. Previously, we were using Fedora 34 with
clang-tools-extra-12.0.1-1.fc34.x86_64.
As Fedora 35 comes along, we need to update our formatting as Fedora 35
comes with version "13.0.0~rc1-1.fc35".
An alternative would be to freeze on version 12, but that has different
problems (like, it's cumbersome to rebuild clang 12 on Fedora 35 and it
would be cumbersome for our developers which are on Fedora 35 to use a
clang that they cannot easily install).
The (differently painful) solution is to reformat from time to time, as we
switch to a new Fedora (and thus clang) version.
Usually we would expect that such a reformatting brings minor changes.
But this time, the changes are huge. That is mentioned in the release
notes [1] as
Makes PointerAligment: Right working with AlignConsecutiveDeclarations. (Fixes https://llvm.org/PR27353)
[1] https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#clang-format
When using OVS link aggregation ports, NetworkManager ovsdb is removing
the ports when cleaning it up. If that happens, it should deactivate the
device even if it does not have controller or the state is not
assume/external.
An interface that is port of the OVS bonding can be activated before the
ovsdb clean up, if it is not deactivated then NetworkManager will finish
with a wrong configuration. The 'ovsdb_device_removed()' is already
checking that the device is "ovs-interface" with subtype "system".
This is a refactor of IP configuration done by NM to make it more
independent from NMDevice.
See these files for more information:
src/core/README.l3cfg.md
src/core/README.next.ip-config.md
https://bugzilla.redhat.com/show_bug.cgi?id=1868254
Problem: if l3cfg commits an address and routes from DHCP, when the
address expires those objects are removed automatically. NM tracks the
objects as missing as if the user removed them. This is to prevent
l3cfg to committing them again. If the lease if renewed, l3cfg should
be allowed to commit those objects again.
Introduce a l3cd flag to indicate that it should be force-committed
once, and propagate this flag to platform objects. In this way, l3cfg
can avoid committing again objects that are removed externally, but it
can commit them when the l3cd changes.
Fixes-test: @bridge_down_to_l2_only
If an address is removed externally, it should be considered ready
from ACD point of view. In this way it can be commit again (for
example, if the DHCP lease is renewed).
When a route has the connectivity check enabled and does not have
full connectivity, it should have its route metric penalized,
this way this route will not be preferred over others.
Fixes-test: @per_device_connectivity_check
DNS manager always sets `priv->config_changed = TRUE` and overwrites
the "resolv.conf" file. To fix it, compare the new configuration with
the old configuration, if there is no change, skipping the update.
Fixes-test: @ipv4_ignore_resolveconf_with_ignore_auto_dns
Fixes-test: @ipv4_ignore_resolveconf_with_ignore_auto_dns_var1
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1023
When doing a reapply the ip_state must be set as PENDING, if not the
ipdhcp_state won't be extended to ip_state.
In addition, if one of the IP configuration is ready and the other may
fail, then we should consider it ready. The other ip state does not
matter at all, it can be none too.
Fixes-test: @nmcli_device_reapply_routes
'no_lease_timeout' is the timeout to get the initial lease and to
renew it once it was lost. It should be scheduled when the client is
started.
Fixes-test: @dhcp4_outages_in_various_situation
When the route is not a default route 0.0.0.0/0, NetworkManager should
not add dependent routes.
Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net>
Sticky update flag forces a commit at UPDATE level after unmanaging
a device. As a result, all the link local addresses will be removed.
To prevent the commit after unmanaging a device, clear sticky update
flag.
Signed-off-by: Wen Liang <liangwen12year@gmail.com>
If addrgenmode=0 is already set, the function should still toggle
disable_ipv6 if needed, to stop the generation of temporary addresses.
Also, it should store the last set value into 'previous_mode_val'.
Fixes-test: @ipv6_keep_external_routes
If the authentication is optional, we are going to re-enter stage2. Set
the "ready" variable so that we can return success immediately and
skip to stage3.
If we had a lease and it expired, don't fail immediately. The client
will try to obtain a new lease and it will send a NO_LEASE_TIMEOUT
event once it fails. Only at that time we should fail.
The "gateway" variable was redundant to best_default_route. It was
somewhat convenient to have, because the best_default_route pointer
might change, but the next hop might still be the same. So it was easy
to track whether it changes.
But it's also redundant information. By relying on best_default_route
alone we have all the information we need.
The IP configuration exported over D-Bus for a device has a "gateway"
property. If the device has a default route without a gateway, before
the L3 rework the gateway used to be exported as "0.0.0.0". That seems
useful to indicate that the device has a default route, but without
a next hop. Restore that behavior.
Fixes-test: @preserve_route_to_generic_device
nm_ether_addr_equal() already accepts NULL addresses and makes a
distinction between NULL and a zero address.
Introduce a similar behavior for nm_ip_addr_equal(), as it's useful in
some cases.
When the parent MAC is updated, a VLAN device also updates its MAC and
then performs a new commit to restore IP configuration. This should
not remove addresses added externally. Change the commit type to
UPDATE.
Fixes-test: @static_route_persists_mac_change
When a virtual interface is removed externally, the device is
unrealized and the ifindex is cleared; this also detaches the existing
l3cfg from the device. At this point the l3cd entry for the device
lingers forever in the DNS manager.
Emit a last L3CD_CHANGED so that the old entry gets removed.
Fixes-test: @disconnect_from_pppoe