network: fix assertion when link get carrier
This fixes a bug introduced by bd08ce5615
.
When link is in LINK_STATE_INITIALIZED, `Link::network` may not be
set yet.
Fixes #12452.
This commit is contained in:
parent
64538af89b
commit
b9ea3d2e47
|
@ -3734,7 +3734,7 @@ int link_ipv6ll_gained(Link *link, const struct in6_addr *address) {
|
|||
link->ipv6ll_address = *address;
|
||||
link_check_ready(link);
|
||||
|
||||
if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_UNMANAGED, LINK_STATE_FAILED)) {
|
||||
if (IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) {
|
||||
r = link_acquire_ipv6_conf(link);
|
||||
if (r < 0) {
|
||||
link_enter_failed(link);
|
||||
|
@ -3750,7 +3750,7 @@ static int link_carrier_gained(Link *link) {
|
|||
|
||||
assert(link);
|
||||
|
||||
if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_UNMANAGED, LINK_STATE_FAILED)) {
|
||||
if (IN_SET(link->state, LINK_STATE_CONFIGURING, LINK_STATE_CONFIGURED)) {
|
||||
r = link_acquire_conf(link);
|
||||
if (r < 0) {
|
||||
link_enter_failed(link);
|
||||
|
|
Loading…
Reference in New Issue