if (!link->network->bridge && !streq_ptr(link->kind, "bridge"))
return 0;
- /* pvid might not be in br_vid_bitmap yet */
- if (link->network->pvid)
- set_bit(link->network->pvid, link->network->br_vid_bitmap);
-
/* create new RTM message */
r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_SETLINK, link->ifindex);
if (r < 0)
return 0;
}
+void network_adjust_bridge_vlan(Network *network) {
+ assert(network);
+
+ if (!network->use_br_vlan)
+ return;
+
+ /* pvid might not be in br_vid_bitmap yet */
+ if (network->pvid)
+ set_bit(network->pvid, network->br_vid_bitmap);
+}
+
int config_parse_brvlan_pvid(
const char *unit,
const char *filename,
#define BRIDGE_VLAN_BITMAP_LEN (BRIDGE_VLAN_BITMAP_MAX / 32)
typedef struct Link Link;
+typedef struct Network Network;
+
+void network_adjust_bridge_vlan(Network *network);
int link_set_bridge_vlan(Link *link);
network_adjust_ipv6_accept_ra(network);
network_adjust_dhcp(network);
network_adjust_radv(network);
+ network_adjust_bridge_vlan(network);
if (network->mtu > 0 && network->dhcp_use_mtu) {
log_warning("%s: MTUBytes= in [Link] section and UseMTU= in [DHCP] section are set. "