From: Felix Fietkau Date: Fri, 23 Jun 2023 09:48:20 +0000 (+0200) Subject: bridge: make hotplug-added vlans default to tagged X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b719f189f243c00cb2a5f32278b60177c1cefcb2;p=project%2Fnetifd.git bridge: make hotplug-added vlans default to tagged This simplifies adding extra vlans and ranges Signed-off-by: Felix Fietkau --- diff --git a/bridge.c b/bridge.c index 0338f14..fb1f196 100644 --- a/bridge.c +++ b/bridge.c @@ -801,7 +801,7 @@ bridge_hotplug_set_member_vlans(struct bridge_state *bst, struct blob_attr *vlan blobmsg_for_each_attr(cur, vlans, rem) { struct bridge_vlan_hotplug_port *port; - uint16_t flags = BRVLAN_F_UNTAGGED; + uint16_t flags = 0; char *name_buf; unsigned int vid; char *end; @@ -828,8 +828,8 @@ bridge_hotplug_set_member_vlans(struct bridge_state *bst, struct blob_attr *vlan for (end++; *end; end++) { switch (*end) { - case 't': - flags &= ~BRVLAN_F_UNTAGGED; + case 'u': + flags |= BRVLAN_F_UNTAGGED; break; case '*': flags |= BRVLAN_F_PVID; diff --git a/vlan.c b/vlan.c index 0d53c31..4e84344 100644 --- a/vlan.c +++ b/vlan.c @@ -51,7 +51,7 @@ __vlan_hotplug_op(struct device *dev, struct device *member, struct blob_attr *v blob_buf_init(&b, 0); a = blobmsg_open_array(&b, "vlans"); - blobmsg_printf(&b, NULL, "%d", vldev->id); + blobmsg_printf(&b, NULL, "%d:u", vldev->id); if (vlan && blobmsg_len(vlan)) blob_put_raw(&b, blobmsg_data(vlan), blobmsg_len(vlan)); blobmsg_close_array(&b, a); diff --git a/vlandev.c b/vlandev.c index bf527bb..43efc17 100644 --- a/vlandev.c +++ b/vlandev.c @@ -72,7 +72,7 @@ __vlandev_hotplug_op(struct device *dev, struct device *member, struct blob_attr blob_buf_init(&b, 0); a = blobmsg_open_array(&b, "vlans"); - blobmsg_printf(&b, NULL, "%d", mvdev->config.vid); + blobmsg_printf(&b, NULL, "%d:u", mvdev->config.vid); if (vlan && blobmsg_len(vlan)) blob_put_raw(&b, blobmsg_data(vlan), blobmsg_len(vlan)); blobmsg_close_array(&b, a);