]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/ndisc: drop all configurations without lifetime on stop
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 23 Feb 2024 03:02:46 +0000 (12:02 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Sun, 25 Feb 2024 11:38:08 +0000 (11:38 +0000)
As we call ndisc_drop_outdated() with USEC_INFINITY on stop.

src/network/networkd-ndisc.c

index b7b1475f6832f057885043e6b8f1a468264a0e30..67f981121b0608fa94d8893d9e0bb94eb342d05b 100644 (file)
@@ -1469,7 +1469,7 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec) {
                 if (route->nexthop.ifindex != link->ifindex)
                         continue;
 
-                if (route->lifetime_usec >= timestamp_usec)
+                if (route->lifetime_usec > timestamp_usec)
                         continue; /* the route is still valid */
 
                 r = route_remove_and_cancel(route, link->manager);
@@ -1481,7 +1481,7 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec) {
                 if (address->source != NETWORK_CONFIG_SOURCE_NDISC)
                         continue;
 
-                if (address->lifetime_valid_usec >= timestamp_usec)
+                if (address->lifetime_valid_usec > timestamp_usec)
                         continue; /* the address is still valid */
 
                 r = address_remove_and_cancel(address, link);
@@ -1490,7 +1490,7 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec) {
         }
 
         SET_FOREACH(rdnss, link->ndisc_rdnss) {
-                if (rdnss->lifetime_usec >= timestamp_usec)
+                if (rdnss->lifetime_usec > timestamp_usec)
                         continue; /* the DNS server is still valid */
 
                 free(set_remove(link->ndisc_rdnss, rdnss));
@@ -1498,7 +1498,7 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec) {
         }
 
         SET_FOREACH(dnssl, link->ndisc_dnssl) {
-                if (dnssl->lifetime_usec >= timestamp_usec)
+                if (dnssl->lifetime_usec > timestamp_usec)
                         continue; /* the DNS domain is still valid */
 
                 free(set_remove(link->ndisc_dnssl, dnssl));
@@ -1506,7 +1506,7 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec) {
         }
 
         SET_FOREACH(cp, link->ndisc_captive_portals) {
-                if (cp->lifetime_usec >= timestamp_usec)
+                if (cp->lifetime_usec > timestamp_usec)
                         continue; /* the captive portal is still valid */
 
                 ndisc_captive_portal_free(set_remove(link->ndisc_captive_portals, cp));
@@ -1514,7 +1514,7 @@ static int ndisc_drop_outdated(Link *link, usec_t timestamp_usec) {
         }
 
         SET_FOREACH(p64, link->ndisc_pref64) {
-                if (p64->lifetime_usec >= timestamp_usec)
+                if (p64->lifetime_usec > timestamp_usec)
                         continue; /* the pref64 prefix is still valid */
 
                 free(set_remove(link->ndisc_pref64, p64));