mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-31 01:47:15 +03:00
networkd: check explicit state rather than link->network
When deserializing we can now have an attached network without the various clients yet having been configured. Hence, don't misused the link->network as a check to determine if a link is ready to be used, but check the state explicitly.
This commit is contained in:
parent
3098562c92
commit
a56a2048f9
@ -506,9 +506,6 @@ static int link_stop_clients(Link *link) {
|
|||||||
assert(link->manager);
|
assert(link->manager);
|
||||||
assert(link->manager->event);
|
assert(link->manager->event);
|
||||||
|
|
||||||
if (!link->network)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (link->dhcp_client) {
|
if (link->dhcp_client) {
|
||||||
k = sd_dhcp_client_stop(link->dhcp_client);
|
k = sd_dhcp_client_stop(link->dhcp_client);
|
||||||
if (k < 0)
|
if (k < 0)
|
||||||
@ -2485,7 +2482,7 @@ int link_ipv6ll_gained(Link *link) {
|
|||||||
link->ipv6ll_address = true;
|
link->ipv6ll_address = true;
|
||||||
link_check_ready(link);
|
link_check_ready(link);
|
||||||
|
|
||||||
if (link->network) {
|
if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_PENDING, LINK_STATE_UNMANAGED, LINK_STATE_FAILED)) {
|
||||||
r = link_acquire_ipv6_conf(link);
|
r = link_acquire_ipv6_conf(link);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
link_enter_failed(link);
|
link_enter_failed(link);
|
||||||
@ -2501,7 +2498,7 @@ static int link_carrier_gained(Link *link) {
|
|||||||
|
|
||||||
assert(link);
|
assert(link);
|
||||||
|
|
||||||
if (link->network) {
|
if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_PENDING, LINK_STATE_UNMANAGED, LINK_STATE_FAILED)) {
|
||||||
r = link_acquire_conf(link);
|
r = link_acquire_conf(link);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
link_enter_failed(link);
|
link_enter_failed(link);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user