summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-07-02 20:15:10 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-07-02 20:59:38 +0900
commitfe139e8ef9bcd985b9df495edf4f97e40d5332ea (patch)
tree5769938848e7d1a746c2b11fc5f17f751d04be19
parent790736e42e39476409be55113a796132f041d256 (diff)
downloadsystemd-fe139e8ef9bcd985b9df495edf4f97e40d5332ea.tar.gz
network: drop old ndisc configurations after new ones are configured
Previously, `ndisc_remove_old_one()` checked `ndisc_{addresses,routes}_configured` flags, but they are not unset when all addresses or routes are already assigned. After the request queue is implemented, the address or route requests are not processed within the same event of ndisc handler is called, but will processed later when they are ready. So, calling `ndisc_remove_old()` in the event of ndisc handler will remove all addresses and routes previously assigned even they are requested to be updated. This makes `ndisc_remove_old()` do nothing when there exist some requests to configure addresses and routes, thus previously assigned addresses and routes are kept until all requests are processed. Fixes #20050.
-rw-r--r--src/network/networkd-ndisc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c
index 444147c305..eebcea1a69 100644
--- a/src/network/networkd-ndisc.c
+++ b/src/network/networkd-ndisc.c
@@ -128,9 +128,6 @@ static int ndisc_remove_old_one(Link *link, const struct in6_addr *router, bool
if (!force) {
bool set_callback = false;
- if (!link->ndisc_addresses_configured || !link->ndisc_routes_configured)
- return 0;
-
SET_FOREACH(na, link->ndisc_addresses)
if (!na->marked && in6_addr_equal(&na->router, router)) {
set_callback = true;
@@ -212,6 +209,10 @@ static int ndisc_remove_old(Link *link) {
assert(link);
+ if (link->ndisc_addresses_messages > 0 ||
+ link->ndisc_routes_messages > 0)
+ return 0;
+
routers = set_new(&in6_addr_hash_ops);
if (!routers)
return -ENOMEM;