Skip to content

Commit

Permalink
networkd: Allow to retain configs even if carrier is lost
Browse files Browse the repository at this point in the history
Closes #9111
  • Loading branch information
Susant Sahani committed Jun 1, 2018
1 parent 33de6b5 commit a9cc018
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions man/systemd.network.xml
Expand Up @@ -772,6 +772,15 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>IgnoreCarrierLoss=</varname></term>
<listitem>
<para>A boolean. Allows networkd to retain the configure even if no carrier.
Defaults to false.
</para>
</listitem>
</varlistentry>

</variablelist>

</refsect1>
Expand Down
2 changes: 1 addition & 1 deletion src/network/networkd-link.c
Expand Up @@ -3157,7 +3157,7 @@ static int link_carrier_lost(Link *link) {
/* 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. */
if (link->setting_mtu)
if (link->setting_mtu || link->network->ignore_carrier_loss)
return 0;

r = link_stop_clients(link);
Expand Down
1 change: 1 addition & 0 deletions src/network/networkd-network-gperf.gperf
Expand Up @@ -78,6 +78,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
Expand Down
1 change: 1 addition & 0 deletions src/network/networkd-network.h
Expand Up @@ -216,6 +216,7 @@ struct Network {
int multicast;
bool unmanaged;
bool configure_without_carrier;
bool ignore_carrier_loss;
uint32_t iaid;
DUID duid;

Expand Down

0 comments on commit a9cc018

Please sign in to comment.