1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 17:51:22 +03:00

Move link_check_ready() to later in the file

We're about to need it to be later in the file for the next commit.
Moving it now means that when we change it in the next commit, it's
not intermingled with the move.

No functional change intended.

Signed-off-by: Daniel Axtens <dja@axtens.net>
This commit is contained in:
Daniel Axtens 2018-12-05 20:39:41 +11:00
parent d253a45e1c
commit 6accfd3139

View File

@ -730,63 +730,6 @@ static void link_enter_configured(Link *link) {
link_dirty(link);
}
void link_check_ready(Link *link) {
Address *a;
Iterator i;
assert(link);
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
return;
if (!link->network)
return;
if (!link->addresses_configured)
return;
if (!link->neighbors_configured)
return;
if (!link->static_routes_configured)
return;
if (!link->routing_policy_rules_configured)
return;
if (link_ipv4ll_enabled(link))
if (!link->ipv4ll_address ||
!link->ipv4ll_route)
return;
if (!link->network->bridge) {
if (link_ipv6ll_enabled(link))
if (in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address) > 0)
return;
if ((link_dhcp4_enabled(link) && !link_dhcp6_enabled(link) &&
!link->dhcp4_configured) ||
(link_dhcp6_enabled(link) && !link_dhcp4_enabled(link) &&
!link->dhcp6_configured) ||
(link_dhcp4_enabled(link) && link_dhcp6_enabled(link) &&
!link->dhcp4_configured && !link->dhcp6_configured))
return;
if (link_ipv6_accept_ra_enabled(link) && !link->ndisc_configured)
return;
}
SET_FOREACH(a, link->addresses, i)
if (!address_is_ready(a))
return;
if (link->state != LINK_STATE_CONFIGURED)
link_enter_configured(link);
return;
}
static int link_request_set_routing_policy_rule(Link *link) {
RoutingPolicyRule *rule, *rrule = NULL;
int r;
@ -900,6 +843,63 @@ static int link_request_set_routes(Link *link) {
return 0;
}
void link_check_ready(Link *link) {
Address *a;
Iterator i;
assert(link);
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
return;
if (!link->network)
return;
if (!link->addresses_configured)
return;
if (!link->neighbors_configured)
return;
if (!link->static_routes_configured)
return;
if (!link->routing_policy_rules_configured)
return;
if (link_ipv4ll_enabled(link))
if (!link->ipv4ll_address ||
!link->ipv4ll_route)
return;
if (!link->network->bridge) {
if (link_ipv6ll_enabled(link))
if (in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address) > 0)
return;
if ((link_dhcp4_enabled(link) && !link_dhcp6_enabled(link) &&
!link->dhcp4_configured) ||
(link_dhcp6_enabled(link) && !link_dhcp4_enabled(link) &&
!link->dhcp6_configured) ||
(link_dhcp4_enabled(link) && link_dhcp6_enabled(link) &&
!link->dhcp4_configured && !link->dhcp6_configured))
return;
if (link_ipv6_accept_ra_enabled(link) && !link->ndisc_configured)
return;
}
SET_FOREACH(a, link->addresses, i)
if (!address_is_ready(a))
return;
if (link->state != LINK_STATE_CONFIGURED)
link_enter_configured(link);
return;
}
static int link_request_set_neighbors(Link *link) {
Neighbor *neighbor;
int r;