mirror of
https://github.com/systemd/systemd.git
synced 2025-01-24 06:04:05 +03:00
networkd: Allow to retain configs even if carrier is lost
When there is bad link in the network the carrier goes up/down. This makes networkd stops all the clients and drop config. But if the remote router/dhcpserver running a prevention of DHCP Starvation attack or DHCP Flood attack it does not allow networkd to take a DHCP lease resulting failure in configuration. This patch allows to keep the client running and keep the conf also for this scenario. Closes #9111
This commit is contained in:
parent
2b3943a02b
commit
93b4dab57e
@ -800,6 +800,15 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><varname>IgnoreCarrierLoss=</varname></term>
|
||||
<listitem>
|
||||
<para>A boolean. Allows networkd to retain both the static and dynamic configuration of the
|
||||
interface even if its carrier is lost. Defaults to false.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
|
@ -3500,6 +3500,9 @@ static int link_carrier_lost(Link *link) {
|
||||
|
||||
assert(link);
|
||||
|
||||
if (link->network->ignore_carrier_loss)
|
||||
return 0;
|
||||
|
||||
/* Some devices reset itself while setting the MTU. This causes the DHCP client fall into a loop.
|
||||
* setting_mtu keep track whether the device got reset because of setting MTU and does not drop the
|
||||
* configuration and stop the clients as well. */
|
||||
|
@ -81,6 +81,7 @@ Network.ProxyARP, config_parse_tristate,
|
||||
Network.IPv6ProxyNDPAddress, config_parse_ipv6_proxy_ndp_address, 0, 0
|
||||
Network.BindCarrier, config_parse_strv, 0, offsetof(Network, bind_carrier)
|
||||
Network.ConfigureWithoutCarrier, config_parse_bool, 0, offsetof(Network, configure_without_carrier)
|
||||
Network.IgnoreCarrierLoss, config_parse_bool, 0, offsetof(Network, ignore_carrier_loss)
|
||||
Address.Address, config_parse_address, 0, 0
|
||||
Address.Peer, config_parse_address, 0, 0
|
||||
Address.Broadcast, config_parse_broadcast, 0, 0
|
||||
|
@ -224,6 +224,7 @@ struct Network {
|
||||
int allmulticast;
|
||||
bool unmanaged;
|
||||
bool configure_without_carrier;
|
||||
bool ignore_carrier_loss;
|
||||
uint32_t iaid;
|
||||
DUID duid;
|
||||
|
||||
|
@ -116,6 +116,7 @@ VLAN=
|
||||
DHCPServer=
|
||||
BindCarrier=
|
||||
VRF=
|
||||
IgnoreCarrierLoss=
|
||||
[IPv6Prefix]
|
||||
Prefix=
|
||||
OnLink=
|
||||
|
Loading…
x
Reference in New Issue
Block a user