Without CONFIG_BRIDGE_IGMP_SNOOPING,
BR_INPUT_SKB_CB(skb)->mrouters_only is not appropriately
initialized, so we can see garbage.
A clear option to fix this is to set it even without that
config, but we cannot optimize out the branch.
Let's introduce a macro that returns value of mrouters_only
and let it return 0 without CONFIG_BRIDGE_IGMP_SNOOPING.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
                        goto out;
 
                mdst = br_mdb_get(br, skb);
-               if (mdst || BR_INPUT_SKB_CB(skb)->mrouters_only)
+               if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb))
                        br_multicast_deliver(mdst, skb);
                else
                        br_flood_deliver(br, skb);
 
 
        if (is_multicast_ether_addr(dest)) {
                mdst = br_mdb_get(br, skb);
-               if (mdst || BR_INPUT_SKB_CB(skb)->mrouters_only) {
+               if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) {
                        if ((mdst && !hlist_unhashed(&mdst->mglist)) ||
                            br_multicast_is_router(br))
                                skb2 = skb;
 
 
 struct br_input_skb_cb {
        struct net_device *brdev;
+#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
        int igmp;
        int mrouters_only;
+#endif
 };
 
 #define BR_INPUT_SKB_CB(__skb) ((struct br_input_skb_cb *)(__skb)->cb)
 
+#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
+# define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb)  (BR_INPUT_SKB_CB(__skb)->mrouters_only)
+#else
+# define BR_INPUT_SKB_CB_MROUTERS_ONLY(__skb)  (0)
+#endif
+
 extern struct notifier_block br_device_notifier;
 extern const u8 br_group_address[ETH_ALEN];