mirror of
https://github.com/systemd/systemd.git
synced 2024-11-27 12:13:33 +08:00
network/bridge: fix UseBPDU= and AllowPortToBeRoot=
Fixes bugs caused by 7f9915f0de
.
Fixes #24268.
This commit is contained in:
parent
e3e7185a70
commit
3f504b892b
@ -232,7 +232,7 @@ static int link_configure_fill_message(
|
||||
return r;
|
||||
|
||||
if (link->network->use_bpdu >= 0) {
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_GUARD, link->network->use_bpdu);
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_GUARD, !link->network->use_bpdu);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
@ -256,7 +256,7 @@ static int link_configure_fill_message(
|
||||
}
|
||||
|
||||
if (link->network->allow_port_to_be_root >= 0) {
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, link->network->allow_port_to_be_root);
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_PROTECT, !link->network->allow_port_to_be_root);
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
@ -291,8 +291,8 @@ Priority=23
|
||||
self.assertEqual(self.read_attr('port2', 'brport/path_cost'), '555')
|
||||
self.assertEqual(self.read_attr('port2', 'brport/multicast_fast_leave'), '1')
|
||||
self.assertEqual(self.read_attr('port2', 'brport/unicast_flood'), '1')
|
||||
self.assertEqual(self.read_attr('port2', 'brport/bpdu_guard'), '1')
|
||||
self.assertEqual(self.read_attr('port2', 'brport/root_block'), '1')
|
||||
self.assertEqual(self.read_attr('port2', 'brport/bpdu_guard'), '0')
|
||||
self.assertEqual(self.read_attr('port2', 'brport/root_block'), '0')
|
||||
|
||||
class ClientTestBase(NetworkdTestingUtilities):
|
||||
"""Provide common methods for testing networkd against servers."""
|
||||
|
@ -3786,8 +3786,8 @@ class NetworkdBridgeTests(unittest.TestCase, Utilities):
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'neigh_suppress', '1', allow_enoent=True)
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'learning', '0')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'priority', '23')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'bpdu_guard', '1')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'root_block', '1')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'bpdu_guard', '0')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'root_block', '0')
|
||||
|
||||
def test_bridge_property(self):
|
||||
copy_network_unit('11-dummy.netdev', '12-dummy.netdev', '26-bridge.netdev',
|
||||
@ -3823,8 +3823,8 @@ class NetworkdBridgeTests(unittest.TestCase, Utilities):
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'neigh_suppress', '1', allow_enoent=True)
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'learning', '0')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'priority', '23')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'bpdu_guard', '1')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'root_block', '1')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'bpdu_guard', '0')
|
||||
self.check_bridge_port_attr('bridge99', 'dummy98', 'root_block', '0')
|
||||
|
||||
output = check_output('bridge -d link show test1')
|
||||
print(output)
|
||||
|
Loading…
Reference in New Issue
Block a user