VIF_ATTR_DISABLED,
VIF_ATTR_NETWORK,
VIF_ATTR_NETWORK_VLAN,
+ VIF_ATTR_BRIDGE_ISOLATE,
VIF_ATTR_ISOLATE,
VIF_ATTR_MODE,
VIF_ATTR_PROXYARP,
[VIF_ATTR_DISABLED] = { .name = "disabled", .type = BLOBMSG_TYPE_BOOL },
[VIF_ATTR_NETWORK] = { .name = "network", .type = BLOBMSG_TYPE_ARRAY },
[VIF_ATTR_NETWORK_VLAN] = { .name = "network_vlan", .type = BLOBMSG_TYPE_ARRAY },
+ [VIF_ATTR_BRIDGE_ISOLATE] = { .name = "bridge_isolate", .type = BLOBMSG_TYPE_BOOL },
[VIF_ATTR_ISOLATE] = { .name = "isolate", .type = BLOBMSG_TYPE_BOOL },
[VIF_ATTR_MODE] = { .name = "mode", .type = BLOBMSG_TYPE_STRING },
[VIF_ATTR_PROXYARP] = { .name = "proxy_arp", .type = BLOBMSG_TYPE_BOOL },
VLAN_ATTR_DISABLED,
VLAN_ATTR_NETWORK,
VLAN_ATTR_NETWORK_VLAN,
+ VLAN_ATTR_BRIDGE_ISOLATE,
VLAN_ATTR_ISOLATE,
VLAN_ATTR_MCAST_TO_UCAST,
__VLAN_ATTR_MAX,
[VLAN_ATTR_DISABLED] = { .name = "disabled", .type = BLOBMSG_TYPE_BOOL },
[VLAN_ATTR_NETWORK] = { .name = "network", .type = BLOBMSG_TYPE_ARRAY },
[VLAN_ATTR_NETWORK_VLAN] = { .name = "network_vlan", .type = BLOBMSG_TYPE_ARRAY },
+ [VLAN_ATTR_BRIDGE_ISOLATE] = { .name = "bridge_isolate", .type = BLOBMSG_TYPE_BOOL },
[VLAN_ATTR_ISOLATE] = { .name = "isolate", .type = BLOBMSG_TYPE_BOOL },
[VLAN_ATTR_MCAST_TO_UCAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL },
};
struct interface *iface;
struct blob_attr *cur;
const char *network;
+ struct device *dev;
size_t rem;
if (!vif->network || !vif->ifname)
if (!ifname)
ifname = vif->ifname;
- if (up) {
- struct device *dev = __device_get(ifname, 2, false);
+ if (!up)
+ goto out;
- if (dev && !strcmp(ifname, vif->ifname)) {
- dev->wireless_isolate = vif->isolate;
- dev->wireless_proxyarp = vif->proxyarp;
- dev->wireless = true;
- dev->wireless_ap = vif->ap_mode;
- wireless_device_set_mcast_to_unicast(dev, vif->multicast_to_unicast);
- dev->bpdu_filter = dev->wireless_ap;
- }
- }
+ dev = __device_get(ifname, 2, false);
+ if (!dev)
+ goto out;
+ dev->wireless = true;
+ dev->settings.flags |= DEV_OPT_ISOLATE;
+ dev->settings.isolate = vif->bridge_isolate;
+
+ if (strcmp(ifname, vif->ifname) != 0)
+ goto out;
+
+ dev->wireless_isolate = vif->isolate;
+ dev->wireless_proxyarp = vif->proxyarp;
+ dev->wireless_ap = vif->ap_mode;
+ wireless_device_set_mcast_to_unicast(dev, vif->multicast_to_unicast);
+ dev->bpdu_filter = dev->wireless_ap;
+
+out:
blobmsg_for_each_attr(cur, vif->network, rem) {
network = blobmsg_data(cur);
dev->wireless = true;
dev->wireless_ap = true;
dev->bpdu_filter = true;
+ dev->settings.flags |= DEV_OPT_ISOLATE;
+ dev->settings.isolate = vlan->bridge_isolate;
wireless_device_set_mcast_to_unicast(dev, vlan->multicast_to_unicast);
}
}
cur = tb[VIF_ATTR_MODE];
vif->ap_mode = cur && !strcmp(blobmsg_get_string(cur), "ap");
+ cur = tb[VIF_ATTR_BRIDGE_ISOLATE];
+ vif->bridge_isolate = cur && blobmsg_get_bool(cur);
+
cur = tb[VIF_ATTR_ISOLATE];
- vif->isolate = vif->ap_mode && cur && blobmsg_get_bool(cur);
+ vif->isolate = cur && blobmsg_get_bool(cur);
cur = tb[VIF_ATTR_PROXYARP];
vif->proxyarp = vif->ap_mode && cur && blobmsg_get_bool(cur);
if ((cur = tb[VLAN_ATTR_NETWORK_VLAN]))
vlan->network_vlan = cur;
+ cur = tb[VLAN_ATTR_BRIDGE_ISOLATE];
+ vlan->bridge_isolate = cur && blobmsg_get_bool(cur);
+
cur = tb[VLAN_ATTR_ISOLATE];
- if (cur)
- vlan->isolate = blobmsg_get_bool(cur);
+ vlan->isolate = cur && blobmsg_get_bool(cur);
cur = tb[VLAN_ATTR_MCAST_TO_UCAST];
vlan->multicast_to_unicast = cur ? blobmsg_get_bool(cur) : -1;