diff options
author | Santa Wiryaman <swiryaman@starry.com> | 2021-05-03 18:48:26 -0400 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2022-02-09 17:37:37 +0900 |
commit | 97f27f8a1690cdf32f34edd43121eeda6452676a (patch) | |
tree | c193aa656355438da976ce7986b16efffc915507 /src/network | |
parent | 10139b4e3c345250dbfc0236475e116a5b76a54d (diff) | |
download | systemd-97f27f8a1690cdf32f34edd43121eeda6452676a.tar.gz |
Add support for `isolated` parameter
Add the "Isolated" parameter in the *.network file, e.g.,
[Bridge]
Isolated=true|false
When the Isolated parameter is true, traffic coming out of this port
will only be forward to other ports whose Isolated parameter is false.
When Isolated is not specified, the port uses the kernel default
setting (false).
The "Isolated" parameter was introduced in Linux 4.19.
See man bridge(8) for more details.
But even though the kernel and bridge/iproute2 recognize the "Isolated"
parameter, systemd-networkd did not have a way to set it.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 1 | ||||
-rw-r--r-- | src/network/networkd-network.c | 1 | ||||
-rw-r--r-- | src/network/networkd-network.h | 1 | ||||
-rw-r--r-- | src/network/networkd-setlink.c | 6 |
4 files changed, 9 insertions, 0 deletions
diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 08e3f13f5a..8b19ce006b 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -308,6 +308,7 @@ DHCPServerStaticLease.MACAddress, config_parse_dhcp_static_lease_hwad Bridge.Cost, config_parse_uint32, 0, offsetof(Network, cost) Bridge.UseBPDU, config_parse_tristate, 0, offsetof(Network, use_bpdu) Bridge.HairPin, config_parse_tristate, 0, offsetof(Network, hairpin) +Bridge.Isolated, config_parse_tristate, 0, offsetof(Network, isolated) Bridge.FastLeave, config_parse_tristate, 0, offsetof(Network, fast_leave) Bridge.AllowPortToBeRoot, config_parse_tristate, 0, offsetof(Network, allow_port_to_be_root) Bridge.UnicastFlood, config_parse_tristate, 0, offsetof(Network, unicast_flood) diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index edcd68d616..96806524be 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -437,6 +437,7 @@ int network_load_one(Manager *manager, OrderedHashmap **networks, const char *fi .use_bpdu = -1, .hairpin = -1, + .isolated = -1, .fast_leave = -1, .allow_port_to_be_root = -1, .unicast_flood = -1, diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index f7eb37aced..f933379ac1 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -244,6 +244,7 @@ struct Network { /* Bridge Support */ int use_bpdu; int hairpin; + int isolated; int fast_leave; int allow_port_to_be_root; int unicast_flood; diff --git a/src/network/networkd-setlink.c b/src/network/networkd-setlink.c index 3fbc910aa2..4292f8976f 100644 --- a/src/network/networkd-setlink.c +++ b/src/network/networkd-setlink.c @@ -303,6 +303,12 @@ static int link_configure_fill_message( return r; } + if (link->network->isolated >= 0) { + r = sd_netlink_message_append_u8(req, IFLA_BRPORT_ISOLATED, link->network->isolated); + if (r < 0) + return r; + } + if (link->network->fast_leave >= 0) { r = sd_netlink_message_append_u8(req, IFLA_BRPORT_FAST_LEAVE, link->network->fast_leave); if (r < 0) |