]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/ndisc: also drop SLAAC addresses and routes on reconfiguring
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 9 Feb 2024 05:50:46 +0000 (14:50 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 14 Feb 2024 15:43:12 +0000 (00:43 +0900)
Especially, this is important for routes, as link_drop_managed_routes()
removes only static routes, rather than non-foreign routes.

src/network/networkd-ndisc.c

index 030b4a43394116023ecffbe6c851f74db8499f14..5f93f45b3ce0b3269c719f2496c24c4a83af5af0 100644 (file)
@@ -1640,7 +1640,8 @@ int ndisc_stop(Link *link) {
 void ndisc_flush(Link *link) {
         assert(link);
 
-        /* Remove all RDNSS, DNSSL, and Captive Portal entries, without exception. */
+        /* Remove all addresses, routes, RDNSS, DNSSL, and Captive Portal entries, without exception. */
+        (void) ndisc_drop_outdated(link, /* timestamp_usec = */ USEC_INFINITY);
 
         link->ndisc_rdnss = set_free(link->ndisc_rdnss);
         link->ndisc_dnssl = set_free(link->ndisc_dnssl);