summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-24 23:12:20 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-24 23:44:42 -0400
commit23da66bb402cc6d9bca2eb34e090ccc24dfbf3f5 (patch)
treed819524ea1ee5d6bb92e0156eca418319476e0dd
parent072f9e4af4cf465aca6e263f4dfd6e07786786d2 (diff)
networkd: rename RootBlock to AllowPortToBeRoot
Justification is similar to BPDUGuard rename. "Positive" values are easier. This is a rather uncommon option, so using a slightly longer name should not be a problem, and may in fact may make it easier to guess what the option does without reading the documentation.
-rw-r--r--man/systemd.network.xml4
-rw-r--r--src/network/networkd-link.c2
-rw-r--r--src/network/networkd-network-gperf.gperf2
-rw-r--r--src/network/networkd-network.c1
-rw-r--r--src/network/networkd.h2
5 files changed, 6 insertions, 5 deletions
diff --git a/man/systemd.network.xml b/man/systemd.network.xml
index 196e57dd57..fbb0bef5c2 100644
--- a/man/systemd.network.xml
+++ b/man/systemd.network.xml
@@ -703,11 +703,11 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><varname>RootBlock=</varname></term>
+ <term><varname>AllowPortToBeRoot=</varname></term>
<listitem>
<para>A boolean. Configures whether a given port is allowed to
become a root port. Only used when STP is enabled on the bridge.
- Defaults to off.</para>
+ Defaults to on.</para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 54077db486..f20f68b482 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -870,7 +870,7 @@ static int link_set_bridge(Link *link) {
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_FAST_LEAVE attribute: %m");
- r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, link->network->root_block);
+ r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, !link->network->allow_port_to_be_root);
if (r < 0)
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_PROTECT attribute: %m");
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf
index 1416ba1d32..83224d7109 100644
--- a/src/network/networkd-network-gperf.gperf
+++ b/src/network/networkd-network-gperf.gperf
@@ -76,7 +76,7 @@ Bridge.Cost, config_parse_unsigned, 0
Bridge.UseBPDU, config_parse_bool, 0, offsetof(Network, use_bpdu)
Bridge.HairPin, config_parse_bool, 0, offsetof(Network, hairpin)
Bridge.FastLeave, config_parse_bool, 0, offsetof(Network, fast_leave)
-Bridge.RootBlock, config_parse_bool, 0, offsetof(Network, root_block)
+Bridge.AllowPortToBeRoot, config_parse_bool, 0, offsetof(Network, allow_port_to_be_root)
Bridge.UnicastFlood, config_parse_bool, 0, offsetof(Network, unicast_flood)
BridgeFDB.MACAddress, config_parse_fdb_hwaddr, 0, 0
BridgeFDB.VLANId, config_parse_fdb_vlan_id, 0, 0
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index e757219ec5..d8f42621af 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -108,6 +108,7 @@ static int network_load_one(Manager *manager, const char *filename) {
network->dhcp_client_identifier = DHCP_CLIENT_ID_DUID;
network->use_bpdu = true;
+ network->allow_port_to_be_root = true;
network->unicast_flood = true;
network->llmnr = LLMNR_SUPPORT_YES;
diff --git a/src/network/networkd.h b/src/network/networkd.h
index 7aade401d8..a285a4b08f 100644
--- a/src/network/networkd.h
+++ b/src/network/networkd.h
@@ -153,7 +153,7 @@ struct Network {
bool use_bpdu;
bool hairpin;
bool fast_leave;
- bool root_block;
+ bool allow_port_to_be_root;
bool unicast_flood;
unsigned cost;