1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-21 02:50:18 +03:00

Merge pull request #22471 from yuwata/network-bridge-vlan-protocol

network: bridge: fix vlan protocol
This commit is contained in:
Yu Watanabe 2022-02-10 20:40:04 +09:00 committed by GitHub
commit 2d88df457a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 4 deletions

View File

@ -121,7 +121,7 @@ static int netdev_bridge_post_create_message(NetDev *netdev, sd_netlink_message
}
if (b->vlan_protocol >= 0) {
r = sd_netlink_message_append_u16(req, IFLA_BR_VLAN_PROTOCOL, b->vlan_protocol);
r = sd_netlink_message_append_u16(req, IFLA_BR_VLAN_PROTOCOL, htobe16(b->vlan_protocol));
if (r < 0)
return r;
}

View File

@ -6,10 +6,14 @@ Kind=bridge
[Bridge]
HelloTimeSec=9
MaxAgeSec=9
ForwardDelaySec=9
AgeingTimeSec=9
ForwardDelaySec=9
Priority=9
MulticastQuerier= true
MulticastSnooping=true
#GroupForwardMask=9 # This interferes other other settings
DefaultPVID=9
MulticastQuerier=yes
MulticastSnooping=yes
VLANFiltering=yes
VLANProtocol=802.1ad
STP=true
MulticastIGMPVersion=3

View File

@ -1185,6 +1185,12 @@ class NetworkdNetDevTests(unittest.TestCase, Utilities):
self.assertRegex(output, 'STP: yes')
self.assertRegex(output, 'Multicast IGMP Version: 3')
output = check_output('ip -d link show bridge99')
print(output)
self.assertIn('vlan_filtering 1 ', output)
self.assertIn('vlan_protocol 802.1ad ', output)
self.assertIn('vlan_default_pvid 9 ', output)
def test_bond(self):
copy_unit_to_networkd_unit_path('25-bond.netdev', '25-bond-balanced-tlb.netdev')
start_networkd()