mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-13 12:58:20 +03:00
network: dhcp6pd: check link state earlier before assigning prefixes to downstream
Also, narrow the acceptable range of the states.
This commit is contained in:
parent
a3ad6acf7b
commit
b7f7c78793
@ -547,15 +547,15 @@ static int dhcp6_pd_prefix_distribute(
|
||||
_cleanup_free_ char *buf = NULL;
|
||||
struct in6_addr assigned_prefix;
|
||||
|
||||
if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
|
||||
continue;
|
||||
|
||||
if (!link_dhcp6_pd_is_enabled(link))
|
||||
continue;
|
||||
|
||||
if (link == dhcp6_link && !link->network->dhcp6_pd_assign)
|
||||
continue;
|
||||
|
||||
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
|
||||
continue;
|
||||
|
||||
if (assign_preferred_subnet_id != link_has_preferred_subnet_id(link))
|
||||
continue;
|
||||
|
||||
@ -581,7 +581,7 @@ static int dhcp6_pd_prefix_distribute(
|
||||
}
|
||||
|
||||
static int dhcp6_pd_prepare(Link *link) {
|
||||
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
|
||||
if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
|
||||
return 0;
|
||||
|
||||
if (!link_dhcp6_pd_is_enabled(link))
|
||||
@ -596,7 +596,7 @@ static int dhcp6_pd_prepare(Link *link) {
|
||||
static int dhcp6_pd_finalize(Link *link) {
|
||||
int r;
|
||||
|
||||
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
|
||||
if (!IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED))
|
||||
return 0;
|
||||
|
||||
if (!link_dhcp6_pd_is_enabled(link))
|
||||
|
Loading…
x
Reference in New Issue
Block a user