networkd: Add bridge port capabilities
This PR adds the configuration switches for multicast flooding, neighbor suppression and learning of a bridge port.
This commit is contained in:
committed by
Lennart Poettering
parent
183e8c0bea
commit
7f15b71460
@@ -1595,12 +1595,30 @@ static int link_set_bridge(Link *link) {
|
||||
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_UNICAST_FLOOD attribute: %m");
|
||||
}
|
||||
|
||||
if (link->network->multicast_flood >= 0) {
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_MCAST_FLOOD, link->network->multicast_flood);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_MCAST_FLOOD attribute: %m");
|
||||
}
|
||||
|
||||
if (link->network->multicast_to_unicast >= 0) {
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_MCAST_TO_UCAST, link->network->multicast_to_unicast);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_MCAST_TO_UCAST attribute: %m");
|
||||
}
|
||||
|
||||
if (link->network->neighbor_suppression >= 0) {
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_NEIGH_SUPPRESS, link->network->neighbor_suppression);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_NEIGH_SUPPRESS attribute: %m");
|
||||
}
|
||||
|
||||
if (link->network->learning >= 0) {
|
||||
r = sd_netlink_message_append_u8(req, IFLA_BRPORT_LEARNING, link->network->learning);
|
||||
if (r < 0)
|
||||
return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_LEARNING attribute: %m");
|
||||
}
|
||||
|
||||
if (link->network->cost != 0) {
|
||||
r = sd_netlink_message_append_u32(req, IFLA_BRPORT_COST, link->network->cost);
|
||||
if (r < 0)
|
||||
|
||||
@@ -170,7 +170,10 @@ Bridge.HairPin, config_parse_tristate,
|
||||
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)
|
||||
Bridge.MulticastFlood, config_parse_tristate, 0, offsetof(Network, multicast_flood)
|
||||
Bridge.MulticastToUnicast, config_parse_tristate, 0, offsetof(Network, multicast_to_unicast)
|
||||
Bridge.NeighborSuppression, config_parse_tristate, 0, offsetof(Network, neighbor_suppression)
|
||||
Bridge.Learning, config_parse_tristate, 0, offsetof(Network, learning)
|
||||
Bridge.Priority, config_parse_bridge_port_priority, 0, offsetof(Network, priority)
|
||||
BridgeFDB.MACAddress, config_parse_fdb_hwaddr, 0, 0
|
||||
BridgeFDB.VLANId, config_parse_fdb_vlan_id, 0, 0
|
||||
|
||||
@@ -368,7 +368,10 @@ int network_load_one(Manager *manager, const char *filename) {
|
||||
.fast_leave = -1,
|
||||
.allow_port_to_be_root = -1,
|
||||
.unicast_flood = -1,
|
||||
.multicast_flood = -1,
|
||||
.multicast_to_unicast = -1,
|
||||
.neighbor_suppression = -1,
|
||||
.learning = -1,
|
||||
.priority = LINK_BRIDGE_PORT_PRIORITY_INVALID,
|
||||
|
||||
.lldp_mode = LLDP_MODE_ROUTERS_ONLY,
|
||||
|
||||
@@ -179,7 +179,10 @@ struct Network {
|
||||
int fast_leave;
|
||||
int allow_port_to_be_root;
|
||||
int unicast_flood;
|
||||
int multicast_flood;
|
||||
int multicast_to_unicast;
|
||||
int neighbor_suppression;
|
||||
int learning;
|
||||
uint32_t cost;
|
||||
uint16_t priority;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user