network: allow setting VLAN protocol on bridges
Signed-off-by: Rubens Figueiredo <rubens.figueiredo@bisdn.de>
This commit is contained in:
committed by
Lennart Poettering
parent
cf217a0922
commit
4df4df5b56
@@ -126,6 +126,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_VLAN_FILTERING attribute: %m");
|
||||
}
|
||||
|
||||
if (b->vlan_protocol >= 0) {
|
||||
r = sd_netlink_message_append_u16(req, IFLA_BR_VLAN_PROTOCOL, b->vlan_protocol);
|
||||
if (r < 0)
|
||||
return log_netdev_error_errno(netdev, r, "Could not append IFLA_BR_VLAN_PROTOCOL attribute: %m");
|
||||
}
|
||||
|
||||
if (b->stp >= 0) {
|
||||
r = sd_netlink_message_append_u32(req, IFLA_BR_STP_STATE, b->stp);
|
||||
if (r < 0)
|
||||
@@ -346,6 +352,7 @@ static void bridge_init(NetDev *n) {
|
||||
b->mcast_querier = -1;
|
||||
b->mcast_snooping = -1;
|
||||
b->vlan_filtering = -1;
|
||||
b->vlan_protocol = -1;
|
||||
b->stp = -1;
|
||||
b->default_pvid = VLANID_INVALID;
|
||||
b->forward_delay = USEC_INFINITY;
|
||||
|
||||
@@ -13,6 +13,7 @@ typedef struct Bridge {
|
||||
int mcast_querier;
|
||||
int mcast_snooping;
|
||||
int vlan_filtering;
|
||||
int vlan_protocol;
|
||||
int stp;
|
||||
uint16_t priority;
|
||||
uint16_t group_fwd_mask;
|
||||
|
||||
@@ -206,6 +206,7 @@ Bridge.DefaultPVID, config_parse_default_port_vlanid,
|
||||
Bridge.MulticastQuerier, config_parse_tristate, 0, offsetof(Bridge, mcast_querier)
|
||||
Bridge.MulticastSnooping, config_parse_tristate, 0, offsetof(Bridge, mcast_snooping)
|
||||
Bridge.VLANFiltering, config_parse_tristate, 0, offsetof(Bridge, vlan_filtering)
|
||||
Bridge.VLANProtocol, config_parse_vlanprotocol, 0, offsetof(Bridge, vlan_protocol)
|
||||
Bridge.STP, config_parse_tristate, 0, offsetof(Bridge, stp)
|
||||
Bridge.MulticastIGMPVersion, config_parse_uint8, 0, offsetof(Bridge, igmp_version)
|
||||
VRF.TableId, config_parse_uint32, 0, offsetof(Vrf, table) /* deprecated */
|
||||
|
||||
Reference in New Issue
Block a user