return log_link_warning_errno(dhcp6_link, r, "Failed to get timestamp of DHCPv6 lease: %m");
HASHMAP_FOREACH(link, dhcp6_link->manager->links_by_index) {
- if (link == dhcp6_link)
- continue;
-
r = dhcp6_pd_prepare(link);
- if (r < 0)
+ if (r < 0) {
+ /* When failed on the upstream interface (i.e., the case link == dhcp6_link),
+ * immediately abort the assignment of the prefixes. As, the all assigned
+ * prefixes will be dropped soon in link_enter_failed(), and it is meaningless
+ * to continue the assignment. */
+ if (link == dhcp6_link)
+ return r;
+
link_enter_failed(link);
+ }
}
for (sd_dhcp6_lease_reset_pd_prefix_iter(dhcp6_link->dhcp6_lease);;) {
}
HASHMAP_FOREACH(link, dhcp6_link->manager->links_by_index) {
- if (link == dhcp6_link)
- continue;
-
r = dhcp6_pd_finalize(link);
- if (r < 0)
+ if (r < 0) {
+ if (link == dhcp6_link)
+ return r;
+
link_enter_failed(link);
+ }
}
return 0;