mirror of
https://github.com/systemd/systemd.git
synced 2025-03-28 02:50:16 +03:00
networkd: Allow configure a specific link even if it has no carrier. (#6740)
This work allows to configure a specific link even if it has no carrier. Closes #6645.
This commit is contained in:
parent
c70b51a7b9
commit
dad2d78e1a
@ -718,6 +718,14 @@
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><varname>ConfigureWithoutCarrier=</varname></term>
|
||||
<listitem>
|
||||
<para>A boolean. Allows networkd to configure a specific link even if it has no carrier.
|
||||
Defaults to false.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</refsect1>
|
||||
|
@ -2138,7 +2138,7 @@ static int link_joined(Link *link) {
|
||||
/* Skip setting up addresses until it gets carrier,
|
||||
or it would try to set addresses twice,
|
||||
which is bad for non-idempotent steps. */
|
||||
if (!link_has_carrier(link))
|
||||
if (!link_has_carrier(link) && !link->network->configure_without_carrier)
|
||||
return 0;
|
||||
|
||||
return link_enter_set_addresses(link);
|
||||
@ -2647,7 +2647,7 @@ static int link_configure(Link *link) {
|
||||
return r;
|
||||
}
|
||||
|
||||
if (link_has_carrier(link)) {
|
||||
if (link_has_carrier(link) || link->network->configure_without_carrier) {
|
||||
r = link_acquire_conf(link);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
@ -70,6 +70,7 @@ Network.IPv4ProxyARP, config_parse_tristate,
|
||||
Network.ProxyARP, config_parse_tristate, 0, offsetof(Network, proxy_arp)
|
||||
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)
|
||||
Address.Address, config_parse_address, 0, 0
|
||||
Address.Peer, config_parse_address, 0, 0
|
||||
Address.Broadcast, config_parse_broadcast, 0, 0
|
||||
|
@ -201,6 +201,7 @@ struct Network {
|
||||
size_t mtu;
|
||||
int arp;
|
||||
bool unmanaged;
|
||||
bool configure_without_carrier;
|
||||
uint32_t iaid;
|
||||
DUID duid;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user