From: Felix Fietkau Date: Wed, 21 Jun 2023 18:46:24 +0000 (+0200) Subject: vlan/vlandev: pass through extra vlan information passed via hotplug X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=077e05f2b129ce59aecef5f8f6b2afe4f01ca1c8;p=project%2Fnetifd.git vlan/vlandev: pass through extra vlan information passed via hotplug This adds support for adding extra tagged VLANs in addition to the primary one Signed-off-by: Felix Fietkau --- diff --git a/vlan.c b/vlan.c index 4d32b60..0d53c31 100644 --- a/vlan.c +++ b/vlan.c @@ -52,6 +52,8 @@ __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); + if (vlan && blobmsg_len(vlan)) + blob_put_raw(&b, blobmsg_data(vlan), blobmsg_len(vlan)); blobmsg_close_array(&b, a); if (add) diff --git a/vlandev.c b/vlandev.c index ad4c526..bf527bb 100644 --- a/vlandev.c +++ b/vlandev.c @@ -73,6 +73,8 @@ __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); + if (vlan && blobmsg_len(vlan)) + blob_put_raw(&b, blobmsg_data(vlan), blobmsg_len(vlan)); blobmsg_close_array(&b, a); if (add)