From b719f189f243c00cb2a5f32278b60177c1cefcb2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 23 Jun 2023 11:48:20 +0200 Subject: [PATCH] bridge: make hotplug-added vlans default to tagged This simplifies adding extra vlans and ranges Signed-off-by: Felix Fietkau --- bridge.c | 6 +++--- vlan.c | 2 +- vlandev.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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); -- 2.30.2