From: Felix Fietkau Date: Tue, 27 Jun 2023 08:48:26 +0000 (+0200) Subject: bridge: add support for configuring extra vlans for the bridge itself X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=03a61994771766a7ae7252531df75893bce210a5;p=project%2Fnetifd.git bridge: add support for configuring extra vlans for the bridge itself Can be configured in the same way as extra bridge member vlans Signed-off-by: Felix Fietkau --- diff --git a/bridge.c b/bridge.c index 2e9cca3..b4dddb8 100644 --- a/bridge.c +++ b/bridge.c @@ -351,13 +351,14 @@ static void bridge_stp_notify(struct bridge_state *bst) static int bridge_enable_interface(struct bridge_state *bst) { - int ret; + struct device *dev = &bst->dev; + int i, ret; if (bst->active) return 0; bridge_stp_notify(bst); - ret = system_bridge_addbr(&bst->dev, &bst->config); + ret = system_bridge_addbr(dev, &bst->config); if (ret < 0) return ret; @@ -368,6 +369,10 @@ bridge_enable_interface(struct bridge_state *bst) bridge_set_local_vlans(bst, true); } + for (i = 0; i < dev->n_extra_vlan; i++) + system_bridge_vlan(dev->ifname, dev->extra_vlan[i].start, + dev->extra_vlan[i].end, true, BRVLAN_F_SELF); + bst->active = true; return 0; }