diff options
author | Linus Lüssing <linus.luessing@c0d3.blue> | 2015-08-23 17:19:27 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-08-25 08:46:30 +0200 |
commit | 1488a64acb77f721fc10d90b0453d95b488460e1 (patch) | |
tree | d3a3849cfc1d0cbfc467dba7b3ee7fff7e56282e /device.c | |
parent | 827145f01d849c663f18e356157fd71f1a7cc45d (diff) |
bridge: Allow setting multicast_to_unicast option
With this patch the multicast_to_unicast feature can be disabled for all
wireless interfaces via an according option on the uci bridge interface.
This patch also exports the setting information to wireless handler
scripts. The hostapd script will need that information to determine
whether to enable or disable ap-isolation, for instance.
Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -48,6 +48,7 @@ static const struct blobmsg_policy dev_attrs[__DEV_ATTR_MAX] = { [DEV_ATTR_RPS] = { .name = "rps", .type = BLOBMSG_TYPE_BOOL }, [DEV_ATTR_XPS] = { .name = "xps", .type = BLOBMSG_TYPE_BOOL }, [DEV_ATTR_DADTRANSMITS] = { .name = "dadtransmits", .type = BLOBMSG_TYPE_INT32 }, + [DEV_ATTR_MULTICAST_TO_UNICAST] = { .name = "multicast_to_unicast", .type = BLOBMSG_TYPE_BOOL }, }; const struct uci_blob_param_list device_attr_list = { @@ -174,6 +175,7 @@ device_merge_settings(struct device *dev, struct device_settings *n) s->neigh6reachabletime : os->neigh6reachabletime; n->dadtransmits = s->flags & DEV_OPT_DADTRANSMITS ? s->dadtransmits : os->dadtransmits; + n->multicast_to_unicast = s->multicast_to_unicast; n->flags = s->flags | os->flags; } @@ -274,6 +276,11 @@ device_init_settings(struct device *dev, struct blob_attr **tb) s->flags |= DEV_OPT_DADTRANSMITS; } + if ((cur = tb[DEV_ATTR_MULTICAST_TO_UNICAST])) { + s->multicast_to_unicast = blobmsg_get_bool(cur); + s->flags |= DEV_OPT_MULTICAST_TO_UNICAST; + } + device_set_disabled(dev, disabled); } @@ -891,6 +898,8 @@ device_dump_status(struct blob_buf *b, struct device *dev) } if (st.flags & DEV_OPT_DADTRANSMITS) blobmsg_add_u32(b, "dadtransmits", st.dadtransmits); + if (st.flags & DEV_OPT_MULTICAST_TO_UNICAST) + blobmsg_add_u8(b, "multicast_to_unicast", st.multicast_to_unicast); } s = blobmsg_open_table(b, "statistics"); |