mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
network: do not bring down bound interfaces immediately
Even if a timespan specified to IgnoreCarrierLoss= for an interface,
when the carrier of the interface lost, bound interfaces might be bring
down immediately.
Let's also postpone bringing down bound interfaces with the specified
timespan.
(cherry picked from commit e8eaed0240
)
This commit is contained in:
parent
f23fe35c9f
commit
9468a6ea47
@ -1769,25 +1769,22 @@ static int link_carrier_gained(Link *link) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int link_carrier_lost_impl(Link *link) {
|
static int link_carrier_lost_impl(Link *link) {
|
||||||
int r, ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
assert(link);
|
assert(link);
|
||||||
|
|
||||||
link->previous_ssid = mfree(link->previous_ssid);
|
link->previous_ssid = mfree(link->previous_ssid);
|
||||||
|
|
||||||
|
ret = link_handle_bound_by_list(link);
|
||||||
|
|
||||||
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
|
if (IN_SET(link->state, LINK_STATE_FAILED, LINK_STATE_LINGER))
|
||||||
return 0;
|
return ret;
|
||||||
|
|
||||||
if (!link->network)
|
if (!link->network)
|
||||||
return 0;
|
return ret;
|
||||||
|
|
||||||
r = link_stop_engines(link, false);
|
RET_GATHER(ret, link_stop_engines(link, false));
|
||||||
if (r < 0)
|
RET_GATHER(ret, link_drop_managed_config(link));
|
||||||
ret = r;
|
|
||||||
|
|
||||||
r = link_drop_managed_config(link);
|
|
||||||
if (r < 0 && ret >= 0)
|
|
||||||
ret = r;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1808,22 +1805,17 @@ static int link_carrier_lost_handler(sd_event_source *s, uint64_t usec, void *us
|
|||||||
static int link_carrier_lost(Link *link) {
|
static int link_carrier_lost(Link *link) {
|
||||||
uint16_t dhcp_mtu;
|
uint16_t dhcp_mtu;
|
||||||
usec_t usec;
|
usec_t usec;
|
||||||
int r;
|
|
||||||
|
|
||||||
assert(link);
|
assert(link);
|
||||||
|
|
||||||
r = link_handle_bound_by_list(link);
|
|
||||||
if (r < 0)
|
|
||||||
return r;
|
|
||||||
|
|
||||||
if (link->iftype == ARPHRD_CAN)
|
if (link->iftype == ARPHRD_CAN)
|
||||||
/* let's shortcut things for CAN which doesn't need most of what's done below. */
|
/* let's shortcut things for CAN which doesn't need most of what's done below. */
|
||||||
return 0;
|
usec = 0;
|
||||||
|
|
||||||
if (!link->network)
|
else if (!link->network)
|
||||||
return 0;
|
usec = 0;
|
||||||
|
|
||||||
if (link->network->ignore_carrier_loss_set)
|
else if (link->network->ignore_carrier_loss_set)
|
||||||
/* If IgnoreCarrierLoss= is explicitly specified, then use the specified value. */
|
/* If IgnoreCarrierLoss= is explicitly specified, then use the specified value. */
|
||||||
usec = link->network->ignore_carrier_loss_usec;
|
usec = link->network->ignore_carrier_loss_usec;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user