diff options
Diffstat (limited to 'net/bridge/br_private.h')
-rw-r--r-- | net/bridge/br_private.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index c7fb5d7a7218..52edecf3c294 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -314,6 +314,7 @@ struct net_bridge | |||
314 | u8 multicast_disabled:1; | 314 | u8 multicast_disabled:1; |
315 | u8 multicast_querier:1; | 315 | u8 multicast_querier:1; |
316 | u8 multicast_query_use_ifaddr:1; | 316 | u8 multicast_query_use_ifaddr:1; |
317 | u8 has_ipv6_addr:1; | ||
317 | 318 | ||
318 | u32 hash_elasticity; | 319 | u32 hash_elasticity; |
319 | u32 hash_max; | 320 | u32 hash_max; |
@@ -588,10 +589,22 @@ static inline bool br_multicast_is_router(struct net_bridge *br) | |||
588 | 589 | ||
589 | static inline bool | 590 | static inline bool |
590 | __br_multicast_querier_exists(struct net_bridge *br, | 591 | __br_multicast_querier_exists(struct net_bridge *br, |
591 | struct bridge_mcast_other_query *querier) | 592 | struct bridge_mcast_other_query *querier, |
593 | const bool is_ipv6) | ||
592 | { | 594 | { |
595 | bool own_querier_enabled; | ||
596 | |||
597 | if (br->multicast_querier) { | ||
598 | if (is_ipv6 && !br->has_ipv6_addr) | ||
599 | own_querier_enabled = false; | ||
600 | else | ||
601 | own_querier_enabled = true; | ||
602 | } else { | ||
603 | own_querier_enabled = false; | ||
604 | } | ||
605 | |||
593 | return time_is_before_jiffies(querier->delay_time) && | 606 | return time_is_before_jiffies(querier->delay_time) && |
594 | (br->multicast_querier || timer_pending(&querier->timer)); | 607 | (own_querier_enabled || timer_pending(&querier->timer)); |
595 | } | 608 | } |
596 | 609 | ||
597 | static inline bool br_multicast_querier_exists(struct net_bridge *br, | 610 | static inline bool br_multicast_querier_exists(struct net_bridge *br, |
@@ -599,10 +612,12 @@ static inline bool br_multicast_querier_exists(struct net_bridge *br, | |||
599 | { | 612 | { |
600 | switch (eth->h_proto) { | 613 | switch (eth->h_proto) { |
601 | case (htons(ETH_P_IP)): | 614 | case (htons(ETH_P_IP)): |
602 | return __br_multicast_querier_exists(br, &br->ip4_other_query); | 615 | return __br_multicast_querier_exists(br, |
616 | &br->ip4_other_query, false); | ||
603 | #if IS_ENABLED(CONFIG_IPV6) | 617 | #if IS_ENABLED(CONFIG_IPV6) |
604 | case (htons(ETH_P_IPV6)): | 618 | case (htons(ETH_P_IPV6)): |
605 | return __br_multicast_querier_exists(br, &br->ip6_other_query); | 619 | return __br_multicast_querier_exists(br, |
620 | &br->ip6_other_query, true); | ||
606 | #endif | 621 | #endif |
607 | default: | 622 | default: |
608 | return false; | 623 | return false; |