| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
reconfigure
Follow-up for 451c2baf30f50b95d73e648058c7c2348dbf0c31.
With the commits, reloading .network files does not release previously
acquired DHCP lease and friends if possible. If previously a DHCP client
was configured as not requesting DNS servers or so, then the previously
acquired lease might not contain any DNS servers. In that case, if the
new .network file enables UseDNS=, then the interface should enter the
configured state after a new lease is acquired. To achieve that, we need
to reset the flags.
With this change, the workaround applied to the test by the commit
451c2baf30f50b95d73e648058c7c2348dbf0c31 can be dropped.
|
|
|
|
| |
It does not save any memory usage but increase code complexity.
|
|
|
|
|
|
|
|
|
| |
Otherwise, even if a link enters the configuring state at the beginning
of link_configure(), link_check_ready() may be called before
link_drop_unmanaged_config() is called, and the link may enter the
configured state.
Fixes #35092.
|
| |
|
|\
| |
| | |
split-out of #34989.
|
| |
| |
| |
| |
| |
| | |
And use it when explicit reconfiguration is requested by Reconfigure() DBus method
or networkd certainly detects that connected network is changed.
Otherwise do not use the flag especially when we come back from sleep mode.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
E.g. when a .network file is updated, but DHCP setting is unchanged, it
is not necessary to drop acquired DHCP lease.
So, let's not stop DHCP client and friends in link_reconfigure_impl(),
but stop them later when we know they are not necessary anymore.
Still DHCP clients and friends are stopped and leases are dropped when
the explicit reconfiguration is requested
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When a reconfiguration of an interface is triggered, previously we
call link_foreignize_config(), which sets all static configurations as
foreign, then later call link_drop_foreign_config(), which drops
unnecessary foreign configurations.
This commit merges these two steps into one, link_drop_unmanaged_config(),
which drops unnecessary static and foreign configurations.
Also, this renames link_drop_managed_configs() to
link_drop_static_config(), as it only drops static configurations.
Note that dynamically aquired configurations are dropped by
link_stop_engines().
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Effectively no functional changes, just refactoring and preparation for
later changes.
- convert boolean flag 'force' to LinkReconfigurationFlag enum,
- merge link_reconfigure() and reconfigure_handler_on_bus_method_reload() as
link_reconfigure_full(),
- Rename ReconfigureData -> LinkReconfigurationData,
- make Reconfigure() DBus message wait for reconfiguration being
started before sending reply.
|
| |
| |
| |
| | |
No functional change, just refactoring.
|
|\ \
| | |
| | |
| | |
| | | |
(#35040)
Closes #32426.
|
| | |
| | |
| | |
| | | |
Closes #32426.
|
|/ /
| |
| |
| |
| |
| |
| |
| | |
It is normal for DHCP leases not to have DNR options. We need to be less
verbose and more forgiving in these cases. Also, if either DHCP does not
have DNR options, make sure to still consider any DHCPv6/RA options.
Fixes: c7c9e3c7c016 (network: adjust log message about DNR)
|
|/
|
|
| |
For justification, see 3f9a0a522f2029e9295ea5e9984259022be88413.
|
|
|
|
|
|
|
| |
We need a sensible limit on the number of Encrypted DNS options allowed
so that the set of resolvers per link does not grow without bound.
Fixes: 0c90d1d2f243 ("ndisc: Parse RFC9463 encrypted DNS (DNR) option")
|
|
|
|
|
| |
KeepConfiguration=dhcp or dhcp-on-stop already violate RFC. It is not
necessary to honor the RFC about sending decline message on stop.
|
|
|
|
| |
They will be used in another file in a later commit.
|
|
|
|
|
| |
This also fixes the position of the logging "Enumeration completed.",
and downgrade its log level.
|
|
|
|
|
|
|
|
| |
We enumerate interfaces at first, then enumerate other configurations
like addresses and so on. If we are running on a container, previously
we started to configure the enumerated interfaces before enumerating other
configurations.
Let's configure interfaces after all configurations are enumerated.
|
| |
|
|
|
|
|
| |
It is currently unused, but will be used later.
Preparation for later commits.
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Inspired by: #34640
|
| | |
|
|\ \
| | |
| | | |
split-out of #34989..
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
No functional change, at least now. Preparation for later commits.
But we are planning to extend KeepConfiguration= and also keep
addresses and so on assigned by other dynamic configuration protocol
like DHCPv6 or NDisc.
However, when link_free_engines() is called here, acquired addresses so
on by NDisc will be removed, even if link_stop_engines() handles
restarting networkd or KeepConfiguration= gracefully.
So, let's not free engines here, but free them later in link_free().
It is not necessary to be called here anyway.
|
| |/
| |
| |
| |
| | |
In that case, requests will never be processed anyway. But further more,
we cannot call link_ref() at that stage. Otherwise, we trigger assertion.
|
| | |
|
|/
|
|
|
| |
When KeepConfiguration=dhcp, we do not remove acquired address, hence
not necessary to restart IPv4LL client.
|
|
|
|
|
|
|
| |
If a tunnel or vxlan is configured with Local=dhcp4 or so, then the
local address needs to be changed when it is changed.
Fixes #24854.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Then, when a .netdev file of a stacked netdev is modified, the netdev
can be reconfigured with the updated setting by something like the
following way:
```
ip link del vlan99
networkctl reload
```
Note, removing the vlan interface in the above example may not be necessary,
e.g. when only VLAN flags, egress mapping, or ingress mapping are updated.
But, it is necessary when VLAN ID is updated.
Closes #9627.
Closes #27177.
Closes #34907.
Replaces #22557.
|