| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Fixes copy-and-paste error in b5b42b516e791aae8b723866be94a7c3e6e99829.
|
| |
| |
| |
| | |
No functional change, just refactoring.
|
| | |
|
| |
| |
| |
| |
| | |
All NextHop objects are managed by Manager since
352eba2e49453a1b784ffbdb9509ba3f8a945b59.
|
| |
| |
| |
| |
| |
| |
| |
| | |
No functional change, as when this function is called, the set will be
freed and contained Route objects will be unref()ed anyway soon later
by nexthop_detach() -> nexthop_free().
Even though, when the routes are forgotten from the Manager, then it is
not necessary to keep them by the nexthop. Let's unref earlier.
|
| |
| |
| |
| |
| |
| | |
Follow-up for 0f8afaf94dd29126981219b3ea2b3bc315cc2dd0.
No functional change, just for safety.
|
| |
| |
| |
| |
| |
| |
| |
| | |
duplicated object
Otherwise, these may be freed twice.
But, fortunately, when this function is called, both are NULL.
So, this should not change any behavior. But for safety.
|
| |
| |
| |
| |
| | |
All Route objects are managed by Manager since
8d01e44c1f0e00b414d36bd1b46ecff548242208.
|
| |
| |
| |
| | |
Closes #34247.
|
|/
|
|
| |
This is currently not used. Preparation for later commit.
|
|
|
|
|
|
| |
The values that were previously hardcoded in sd-varlink.c are now defined
in new varlink_set_info_systemd() and that function is called everywhere
where we create a server.
|
|
|
|
|
|
|
| |
queued
Fixes a bug introduced by ef45f5c8d0bfbeda2a57b28bba9831f044b23b21.
Fixes #35164.
|
|
|
|
| |
Follow-up for 2b07a3211ba8b1b81d6cebb9650d5cb24554b08a.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes IPv6 Core Conformance test failures reported at #33468.
https://www.ipv6ready.org/docs/Core_Conformance.pdf
Test v6LC.2.2.23 h and j: Processing Router Advertisement with Route
Information Option (Host Only)
When a RA contains route option with ::/0 prefix, then previously that
may contradict with the default route requested with the RA header.
If the route option has zero lifetime, the existing default route should
be removed, and a new route based on the RA header should be configured.
If the route option has non-zero lifetime, the RA header should be
ignored.
So, we first need to process options with zero lifetime (not only
route option, as the similar reasons), then configure the default route
based on the RA, finally process options with non-zero lifetime.
|
|
|
|
| |
-EOPNOTSUPP anymore
|
|
|
|
| |
Follow-up for 09db4106064dd600c64d12a4e06bd88143b2e4f7.
|
|
|
|
| |
Follow-up for 688f166972916b5cfc9287055582ac1aeef3d486.
|
|\
| |
| |
| |
| | |
(#35119)
Fixes #33470.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
requested
Previously, when multiple routers send RAs with the same preference,
then the kernel merges routes with the same gateway address:
===
default proto ra metric 1024 expires 595sec pref medium
nexthop via fe80::200:10ff:fe10:1060 dev enp0s9 weight 1
nexthop via fe80::200:10ff:fe10:1061 dev enp0s9 weight 1
===
This causes IPv6 Conformance Test v6LC.2.2.11 failure, as reported in #33470.
To avoid the coalescing issue, we can use nexthop, as suggested by Ido Schimmel:
https://lore.kernel.org/netdev/ZytjEINNRmtpadr_@shredder/
> BTW, you can avoid the coalescing problem by using the nexthop API.
> # ip nexthop add id 1 via fe80::200:10ff:fe10:1060 dev enp0s9
> # ip -6 route add default nhid 1 expires 600 proto ra
> # ip nexthop add id 2 via fe80::200:10ff:fe10:1061 dev enp0s9
> # ip -6 route append default nhid 2 expires 600 proto ra
> # ip -6 route
> fe80::/64 dev enp0s9 proto kernel metric 256 pref medium
> default nhid 1 via fe80::200:10ff:fe10:1060 dev enp0s9 proto ra metric 1024 expires 563sec pref medium
> default nhid 2 via fe80::200:10ff:fe10:1061 dev enp0s9 proto ra metric 1024 expires 594sec pref medium
Fixes #33470.
Suggested-by: Ido Schimmel <idosch@idosch.org>
|
| | |
|
| |
| |
| |
| | |
Preparation for later commits.
|
|\ \
| |/
|/| |
Follow-ups for #34909.
|
| |
| |
| |
| |
| | |
Otherwise, when a .netdev file for tun or tap netdev is updated,
reloading the file leaks the previous file descriptor.
|
| |
| |
| |
| |
| | |
Some bonding parameters cannot be updated when the netdev is already up
or already has at least one slave interface.
|
| |
| |
| |
| |
| | |
Some netdevs cannot update there properties after created.
Let's skip requests in that case.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Follow-up for 1003093604661bd984574889167f2ff4dfd6209c.
If a netdev is detached for some reasons, then previously the request
was simply cancelled, and the underlying interface never enter the
configured state, as the 'stacked_netdevs_created' flag never set.
This makes the counter decremented manually by the function, and set the
flag. So, the underlying interface can eter the configured state.
|
| |
| |
| |
| |
| |
| |
| | |
After PR #34909, networkd tries to update an existing netdev interface if
possible. But, when .netdev files are loaded on start, we have not
enumerate interfaces, so we do not know if the corresponding interface
exists or not. Let's delay processing request a bit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Follow-up for PR #34909.
This fixes an issue that network interfaces cannot join a master netdev,
like bond or bridge, when the corresponding .netdev is reloaded.
With PR #34909, networkd supports reloading .netdev files. However,
When a .netdev file is modified and reloaded, ifindex is copied from
the old NetDev object to the new one. Thus, even if the interface is
successfully updated, netdev_set_ifindex_impl() will return 0 and
netdev_enter_ready() will never called. If the netdev is a kind of
master netdev, then port interfaces cannot join the master netdev,
as REQUEST_TYPE_SET_LINK_MASTER requires that the master netdev is
in the ready state.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Follow-up for 17c5337f7b2993619d84acc2088b2ba1789e6477.
Older kernels (older than v6.5) refuse RTM_NEWLINK messages with IFLA_ADDRESS
attribute when the netdev already exists and is running, even if the MAC
address is unchanged.
So, let's not set IFLA_ADDRESS or IFLA_MTU if they are unchanged, and
set the attributes only when we can update them.
|
| |
| |
| |
| | |
Otherwise, the kernel older than v6.2 will refuse the netlink message.
|
| |
| |
| |
| |
| | |
KeepConfiguration=dhcp keeps not only DHCP configurations but
also SLAAC or IPV4LL. Let's rename the value to 'dynamic'.
|
| |
| |
| |
| |
| | |
This is similar to what we do for DHCPv4 address, but for IPv4LL
address.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
KeepConfiguration=dhcp-on-stop
By the previous commit, configuration source of addresses and routes are
saved on stop and restored on start. Hence, we can keep dynamic
configurations on stop.
Co-authored-by: Jian Zhang <zhangjian.3032@bytedance.com>
|
|/
|
|
|
|
|
|
|
|
| |
Currently, only configuration sources and providers of addresses and
routes are serialized/deserialized.
This should mostly not change behavior, as dynamic (except for DHCPv4)
configurations will be dropped before stopping networkd, and for DHCPv4
protocol, we have already had another logic to handle DHCPv4
configurations.
Preparation for later commits.
|
|
|
|
|
|
|
|
|
|
| |
if existing route can be updated
Follow-up for 972f1d17ab461a51142a142609dd3ec50bae8440.
This fixes the logic of removing unnecessary routes configured by the
previously received RAs. Previously, we wrongly handled existing routes
could be updated, and unexpected routes would be kept.
|
|
|
|
|
|
| |
These applies common parameters to the route to be requested or removed.
No functional change, just refactoring and preparation for later
commits.
|
|
|
|
|
|
| |
- drop unnecessary call of ndisc_set_route_priority() at the beginning,
as it is called later in the loop below,
- use RET_GATHER() and remove all possible routes even if failed.
|
|
|
|
|
|
| |
where applicable
No functional change, and preparation for later commits.
|
|
|
|
| |
Similar to the previous commit, but for nexthop.
|
|
|
|
|
|
|
| |
When an interface went down, IPv4 non-local routes are removed by the
kernel without any notifications. Let's forget the routes in that case.
Fixes #35047.
|
|
|
|
|
|
| |
When a nexthop is removed, routes depend on the removed nexthop are
already removed. It is not necessary to remove them, as already
commented. Let's forget them without trying to remove.
|
|
|
|
|
| |
Previously, when a nexthop is removed, depending nexthops were removed, but
that's not necessary, as the kernel keeps them, at least with v6.11.
|
|
|
|
|
|
| |
Follow-up for 6f09031e4d04727cc72164fefcbc763e37556493.
The function has been introduced by the commit, but it has never been used...
|
|
|
|
|
|
|
|
|
|
|
|
| |
KeepConfiguration=dhcp or yes
Previously, even if KeepConfiguration=dhcp or yes is specified in the
new .network file, dynamic configurations like DHCP address and routes
were dropped when 'networkctl reconfigure INTERFACE' is invoked.
If the setting is specified, let's gracefully handle the dynamic
configurations. Then, 'networkctl reconfigure' can be also used for
an interface that has critical connections.
|
|
|
|
|
|
|
|
|
| |
Follow-up for dd6d53a8dc58c5e6e310b09ba7f7a22600a87ba9.
Unnecessary static configs will be anyway dropped later in
link_configure() -> link_drop_unmanaged_config(). Hence, even if we are
reconfiguring an interface cleanly, it is not necessary to drop static
configs here.
|
|
|
|
|
|
|
|
|
|
|
|
| |
non-upstream interface
Unreachable routes are not owned by any interfaces, and its ifindex is
zero. Previously, if a non-upstream interface is reconfigured, all routes
including unreachable routes configured by the upstream interface are
removed.
This makes unreachable routes are always handled by the upstream interface,
and only removed when the delegated prefixes are changed or lost.
|
|
|
|
| |
Follow-up for 451c2baf30f50b95d73e648058c7c2348dbf0c31.
|