bool mcast_to_ucast = dev->wireless_ap;
bool hairpin;
- if (bridge->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST &&
- !bridge->settings.multicast_to_unicast)
+ if (dev->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST)
+ mcast_to_ucast = dev->settings.multicast_to_unicast;
+ else if (bridge->settings.flags & DEV_OPT_MULTICAST_TO_UNICAST &&
+ !bridge->settings.multicast_to_unicast)
mcast_to_ucast = false;
hairpin = mcast_to_ucast || dev->wireless_proxyarp;
VIF_ATTR_ISOLATE,
VIF_ATTR_MODE,
VIF_ATTR_PROXYARP,
+ VIF_ATTR_MCAST_TO_UCAST,
__VIF_ATTR_MAX,
};
[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 },
+ [VIF_ATTR_MCAST_TO_UCAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL },
};
static const struct uci_blob_param_list vif_param = {
VLAN_ATTR_DISABLED,
VLAN_ATTR_NETWORK,
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_ISOLATE] = { .name = "isolate", .type = BLOBMSG_TYPE_BOOL },
+ [VLAN_ATTR_MCAST_TO_UCAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL },
};
static const struct uci_blob_param_list vlan_param = {
}
}
+static void wireless_device_set_mcast_to_unicast(struct device *dev, int val)
+{
+ if (val < 0) {
+ dev->settings.flags &= ~DEV_OPT_MULTICAST_TO_UNICAST;
+ return;
+ }
+
+ dev->settings.multicast_to_unicast = !!val;
+ dev->settings.flags |= DEV_OPT_MULTICAST_TO_UNICAST;
+}
+
static void wireless_interface_handle_link(struct wireless_interface *vif, const char *ifname, bool up)
{
struct interface *iface;
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->wireless = true;
dev->wireless_ap = true;
dev->bpdu_filter = true;
+ wireless_device_set_mcast_to_unicast(dev, vlan->multicast_to_unicast);
}
}
cur = tb[VIF_ATTR_PROXYARP];
vif->proxyarp = vif->ap_mode && cur && blobmsg_get_bool(cur);
+
+ cur = tb[VIF_ATTR_MCAST_TO_UCAST];
+ vif->multicast_to_unicast = cur ? blobmsg_get_bool(cur) : -1;
}
/* vlist update call for wireless interface list */
cur = tb[VLAN_ATTR_ISOLATE];
if (cur)
vlan->isolate = blobmsg_get_bool(cur);
+
+ cur = tb[VLAN_ATTR_MCAST_TO_UCAST];
+ vlan->multicast_to_unicast = cur ? blobmsg_get_bool(cur) : -1;
}
/* vlist update call for vlan list */