diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/network/networkd-link.c | 5 | ||||
-rw-r--r-- | src/network/networkd-link.h | 2 | ||||
-rw-r--r-- | src/network/networkd-network-gperf.gperf | 3 | ||||
-rw-r--r-- | src/network/networkd-network.c | 1 | ||||
-rw-r--r-- | src/network/networkd-network.h | 3 |
5 files changed, 12 insertions, 2 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 0c1229336b..1797f144b6 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -1325,6 +1325,11 @@ static int link_set_bridge(Link *link) { if (r < 0) return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_COST attribute: %m"); } + if (link->network->priority != LINK_BRIDGE_PORT_PRIORITY_INVALID) { + r = sd_netlink_message_append_u16(req, IFLA_BRPORT_PRIORITY, link->network->priority); + if (r < 0) + return log_link_error_errno(link, r, "Could not append IFLA_BRPORT_PRIORITY attribute: %m"); + } r = sd_netlink_message_close_container(req); if (r < 0) diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index e6190fbe57..010b38248a 100644 --- a/src/network/networkd-link.h +++ b/src/network/networkd-link.h @@ -33,6 +33,8 @@ #include "list.h" #include "set.h" +#define LINK_BRIDGE_PORT_PRIORITY_INVALID 128 + typedef enum LinkState { LINK_STATE_PENDING, LINK_STATE_ENSLAVING, diff --git a/src/network/networkd-network-gperf.gperf b/src/network/networkd-network-gperf.gperf index 68052ba544..9658978651 100644 --- a/src/network/networkd-network-gperf.gperf +++ b/src/network/networkd-network-gperf.gperf @@ -119,12 +119,13 @@ DHCPServer.EmitTimezone, config_parse_bool, DHCPServer.Timezone, config_parse_timezone, 0, offsetof(Network, dhcp_server_timezone) DHCPServer.PoolOffset, config_parse_uint32, 0, offsetof(Network, dhcp_server_pool_offset) DHCPServer.PoolSize, config_parse_uint32, 0, offsetof(Network, dhcp_server_pool_size) -Bridge.Cost, config_parse_unsigned, 0, offsetof(Network, cost) +Bridge.Cost, config_parse_uint32, 0, offsetof(Network, cost) Bridge.UseBPDU, config_parse_bool, 0, offsetof(Network, use_bpdu) Bridge.HairPin, config_parse_bool, 0, offsetof(Network, hairpin) Bridge.FastLeave, config_parse_bool, 0, offsetof(Network, fast_leave) Bridge.AllowPortToBeRoot, config_parse_bool, 0, offsetof(Network, allow_port_to_be_root) Bridge.UnicastFlood, config_parse_bool, 0, offsetof(Network, unicast_flood) +Bridge.Priority, config_parse_uint16, 0, offsetof(Network, priority) BridgeFDB.MACAddress, config_parse_fdb_hwaddr, 0, 0 BridgeFDB.VLANId, config_parse_fdb_vlan_id, 0, 0 BridgeVLAN.PVID, config_parse_brvlan_pvid, 0, 0 diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c index fac42d8478..dd29b4ca48 100644 --- a/src/network/networkd-network.c +++ b/src/network/networkd-network.c @@ -165,6 +165,7 @@ static int network_load_one(Manager *manager, const char *filename) { network->use_bpdu = true; network->allow_port_to_be_root = true; network->unicast_flood = true; + network->priority = LINK_BRIDGE_PORT_PRIORITY_INVALID; network->lldp_mode = LLDP_MODE_ROUTERS_ONLY; diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index 4ce066a764..d6f418d521 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -163,7 +163,8 @@ struct Network { bool fast_leave; bool allow_port_to_be_root; bool unicast_flood; - unsigned cost; + uint32_t cost; + uint16_t priority; bool use_br_vlan; uint16_t pvid; |