Currently multicast to unicast feature may be configured for incorrect wireless interface in case of reconfiguration.
Test case:
Initial wireless configuration:
config wifi-iface
option mode ap
option disabled 1
config wifi-iface
option mode sta
option disabled 0
config wifi-iface
option mode ap
option disabled 0
After reboot, multicast to unicast feature is configured for interface #3 (wlan0-1) only.
Next, enable interface #1 and issue "wifi" command. Now, multicast to unicast feature is configured for interface #2 (wlan0) which is wrong.
It should be configured for interfaces #1 and #3 only. This patch resolves this problem.
Signed-off-by: Dmitry Ivanov <dima@ubnt.com>
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
if ((cur = tb[VIF_ATTR_NETWORK]))
vif->network = cur;
+
+ cur = tb[VIF_ATTR_ISOLATE];
+ if (cur)
+ vif->isolate = blobmsg_get_bool(cur);
+
+ cur = tb[VIF_ATTR_MODE];
+ if (cur)
+ vif->ap_mode = !strcmp(blobmsg_get_string(cur), "ap");
}
static void
vif->section = section;
vif->isolate = false;
- cur = tb[VIF_ATTR_ISOLATE];
- if (cur && blobmsg_get_bool(cur))
- vif->isolate = blobmsg_get_bool(cur);
-
- cur = tb[VIF_ATTR_MODE];
- if (cur && !strcmp(blobmsg_get_string(cur), "ap"))
- vif->ap_mode = true;
-
vlist_add(&wdev->interfaces, &vif->node, vif->name);
}