summaryrefslogtreecommitdiffhomepage
path: root/bridge.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-19 01:00:32 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-19 01:00:32 +0200
commit8c6361136d8c976407b03252b6cfadecb441b37a (patch)
treec33277581916a5653fff9bcf1a7e22bc5502c145 /bridge.c
parent53f8ed2cdcf986389b605c79d273f08b5a687636 (diff)
set the igmp snooping option for bridges
Diffstat (limited to 'bridge.c')
-rw-r--r--bridge.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bridge.c b/bridge.c
index fe4b477..1adabb9 100644
--- a/bridge.c
+++ b/bridge.c
@@ -13,6 +13,7 @@ enum {
BRIDGE_ATTR_IFNAME,
BRIDGE_ATTR_STP,
BRIDGE_ATTR_FORWARD_DELAY,
+ BRIDGE_ATTR_IGMP_SNOOP,
BRIDGE_ATTR_AGEING_TIME,
BRIDGE_ATTR_HELLO_TIME,
BRIDGE_ATTR_MAX_AGE,
@@ -26,6 +27,7 @@ static const struct blobmsg_policy bridge_attrs[__BRIDGE_ATTR_MAX] = {
[BRIDGE_ATTR_AGEING_TIME] = { "ageing_time", BLOBMSG_TYPE_INT32 },
[BRIDGE_ATTR_HELLO_TIME] = { "hello_time", BLOBMSG_TYPE_INT32 },
[BRIDGE_ATTR_MAX_AGE] = { "max_age", BLOBMSG_TYPE_INT32 },
+ [BRIDGE_ATTR_IGMP_SNOOP] = { "igmp_snooping", BLOBMSG_TYPE_BOOL },
};
static const union config_param_info bridge_attr_info[__BRIDGE_ATTR_MAX] = {
@@ -340,6 +342,7 @@ bridge_apply_settings(struct bridge_state *bst, struct blob_attr **tb)
/* defaults */
cfg->stp = true;
cfg->forward_delay = 1;
+ cfg->igmp_snoop = true;
if ((cur = tb[BRIDGE_ATTR_STP]))
cfg->stp = blobmsg_get_bool(cur);
@@ -347,6 +350,9 @@ bridge_apply_settings(struct bridge_state *bst, struct blob_attr **tb)
if ((cur = tb[BRIDGE_ATTR_FORWARD_DELAY]))
cfg->forward_delay = blobmsg_get_u32(cur);
+ if ((cur = tb[BRIDGE_ATTR_IGMP_SNOOP]))
+ cfg->igmp_snoop = blobmsg_get_bool(cur);
+
if ((cur = tb[BRIDGE_ATTR_AGEING_TIME])) {
cfg->ageing_time = blobmsg_get_u32(cur);
cfg->flags |= BRIDGE_OPT_AGEING_TIME;