netifd: bridge: set default value for igmp_snoop
authorZheng Qian <sotux82@gmail.com>
Tue, 2 Mar 2021 01:36:51 +0000 (09:36 +0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 3 Apr 2021 15:08:31 +0000 (17:08 +0200)
When unchecked the igmp snoop option for a bridge by luci, it
just delete the igmp_snooping key from the config file.
So netifd can't change /sys/devices/virtual/net/br-lan/bridge/multicast_snooping from "1" to "0".

Option multicast_querier seems no input entry in luci, but it's
an related option.

This patch will set a default value to false for the bridge
option to fix this bug.

Signed-off-by: Zheng Qian <sotux82@gmail.com>
bridge.c

index b70d626009e9fd84249f8b5334f83edd6dd8354c..099dfe4d24ef957422e89d5ee333b2aa929363f9 100644 (file)
--- a/bridge.c
+++ b/bridge.c
@@ -877,6 +877,8 @@ bridge_apply_settings(struct bridge_state *bst, struct blob_attr **tb)
        cfg->stp = false;
        cfg->forward_delay = 2;
        cfg->robustness = 2;
+       cfg->igmp_snoop = false;
+       cfg->multicast_querier = false;
        cfg->query_interval = 12500;
        cfg->query_response_interval = 1000;
        cfg->last_member_interval = 100;