summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-12-02 09:14:27 -0500
committerGitHub <noreply@github.com>2016-12-02 09:14:27 -0500
commit169f11d5dab59c54888aae545b5ea787ef727224 (patch)
treeb9b29ff4134d98e51b9e3a4e689f52aa8c4746e0 /src/network
parentcd66af227416eb7b9f150b92abff4e4a3e92253b (diff)
parenta09dc5467a3d289a53ef3ea87d3b155d8d0551c9 (diff)
downloadsystemd-169f11d5dab59c54888aae545b5ea787ef727224.tar.gz
Merge pull request #4228 from dm0-/coreos-1554
networkd: support marking links unmanaged
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-link.c3
-rw-r--r--src/network/networkd-network-gperf.gperf1
-rw-r--r--src/network/networkd-network.h1
3 files changed, 5 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index cb7df633b7..643578c164 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2523,6 +2523,9 @@ static int link_initialized_and_synced(sd_netlink *rtnl, sd_netlink_message *m,
if (r == -ENOENT) {
link_enter_unmanaged(link);
return 1;
+ } else if (r == 0 && network->unmanaged) {
+ link_enter_unmanaged(link);
+ return 0;
} else if (r < 0)
return r;
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 463f4595c1..0a5cd763dd 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -29,6 +29,7 @@ Match.Architecture, config_parse_net_condition,
Link.MACAddress, config_parse_hwaddr, 0, offsetof(Network, mac)
Link.MTUBytes, config_parse_iec_size, 0, offsetof(Network, mtu)
Link.ARP, config_parse_tristate, 0, offsetof(Network, arp)
+Link.Unmanaged, config_parse_bool, 0, offsetof(Network, unmanaged)
Network.Description, config_parse_string, 0, offsetof(Network, description)
Network.Bridge, config_parse_netdev, 0, offsetof(Network, bridge)
Network.Bond, config_parse_netdev, 0, offsetof(Network, bond)
diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h
index 4dbc19fc3b..e05dccda29 100644
--- a/src/network/networkd-network.h
+++ b/src/network/networkd-network.h
@@ -176,6 +176,7 @@ struct Network {
struct ether_addr *mac;
size_t mtu;
int arp;
+ bool unmanaged;
uint32_t iaid;
DUID duid;