From 8c6361136d8c976407b03252b6cfadecb441b37a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 19 Oct 2011 01:00:32 +0200 Subject: set the igmp snooping option for bridges --- bridge.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'bridge.c') 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; -- cgit v1.2.3