From: Susant Sahani Date: Wed, 6 Sep 2017 14:57:04 +0000 (+0000) Subject: networkd: Allow configure a specific link even if it has no carrier. (#6740) X-Git-Tag: v235~152 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dad2d78e1a43a46565e24ee436c979b48bf02fcd;p=platform%2Fupstream%2Fsystemd.git 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. --- diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 28a0010..8b0f736 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -718,6 +718,14 @@ + + ConfigureWithoutCarrier= + + A boolean. Allows networkd to configure a specific link even if it has no carrier. + Defaults to false. + + + diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index cba0873..2ad10d2 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -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; diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index a225836..54385b5 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -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 diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index 3f81e20..d55e6f7 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -201,6 +201,7 @@ struct Network { size_t mtu; int arp; bool unmanaged; + bool configure_without_carrier; uint32_t iaid; DUID duid;