1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

Allow configuration of a bridge netdev's group_fwd_mask. (#6759)

This commit is contained in:
b1tninja 2017-09-08 03:36:06 -07:00 committed by Lennart Poettering
parent 815ab79ef6
commit c4819961b1
4 changed files with 18 additions and 0 deletions

View File

@ -341,6 +341,16 @@
means higher priority. The bridge having the lowest priority will be elected as root bridge.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>GroupForwardMask=</varname></term>
<listitem>
<para>A 16-bit bitmask represented as an integer which allows forwarding of link
local frames with 802.1D reserved addresses (01:80:C2:00:00:0X). A logical AND
is performed between the specified bitmask and the exponentiation of 2^X, the
lower nibble of the last octet of the MAC address. For example, a value of 8
would allow forwarding of frames addressed to 01:80:C2:00:00:03 (802.1X PAE).</para>
</listitem>
</varlistentry>
<varlistentry>
<term><varname>DefaultPVID=</varname></term>
<listitem>

View File

@ -103,6 +103,12 @@ static int netdev_bridge_post_create(NetDev *netdev, Link *link, sd_netlink_mess
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BR_PRIORITY attribute: %m");
}
if (b->group_fwd_mask > 0) {
r = sd_netlink_message_append_u16(req, IFLA_BR_GROUP_FWD_MASK, b->group_fwd_mask);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BR_GROUP_FWD_MASK attribute: %m");
}
if (b->default_pvid != VLANID_INVALID) {
r = sd_netlink_message_append_u16(req, IFLA_BR_VLAN_DEFAULT_PVID, b->default_pvid);
if (r < 0)

View File

@ -29,6 +29,7 @@ typedef struct Bridge {
int vlan_filtering;
int stp;
uint16_t priority;
uint16_t group_fwd_mask;
uint16_t default_pvid;
usec_t forward_delay;

View File

@ -129,6 +129,7 @@ Bridge.MaxAgeSec, config_parse_sec, 0,
Bridge.AgeingTimeSec, config_parse_sec, 0, offsetof(Bridge, ageing_time)
Bridge.ForwardDelaySec, config_parse_sec, 0, offsetof(Bridge, forward_delay)
Bridge.Priority, config_parse_uint16, 0, offsetof(Bridge, priority)
Bridge.GroupForwardMask, config_parse_uint16, 0, offsetof(Bridge, group_fwd_mask)
Bridge.DefaultPVID, config_parse_default_port_vlanid, 0, offsetof(Bridge, default_pvid)
Bridge.MulticastQuerier, config_parse_tristate, 0, offsetof(Bridge, mcast_querier)
Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping)