|
@@ -314,6 +314,7 @@ struct net_bridge
|
|
u8 multicast_disabled:1;
|
|
u8 multicast_disabled:1;
|
|
u8 multicast_querier:1;
|
|
u8 multicast_querier:1;
|
|
u8 multicast_query_use_ifaddr:1;
|
|
u8 multicast_query_use_ifaddr:1;
|
|
|
|
+ u8 has_ipv6_addr:1;
|
|
|
|
|
|
u32 hash_elasticity;
|
|
u32 hash_elasticity;
|
|
u32 hash_max;
|
|
u32 hash_max;
|
|
@@ -588,10 +589,22 @@ static inline bool br_multicast_is_router(struct net_bridge *br)
|
|
|
|
|
|
static inline bool
|
|
static inline bool
|
|
__br_multicast_querier_exists(struct net_bridge *br,
|
|
__br_multicast_querier_exists(struct net_bridge *br,
|
|
- struct bridge_mcast_other_query *querier)
|
|
|
|
|
|
+ struct bridge_mcast_other_query *querier,
|
|
|
|
+ const bool is_ipv6)
|
|
{
|
|
{
|
|
|
|
+ bool own_querier_enabled;
|
|
|
|
+
|
|
|
|
+ if (br->multicast_querier) {
|
|
|
|
+ if (is_ipv6 && !br->has_ipv6_addr)
|
|
|
|
+ own_querier_enabled = false;
|
|
|
|
+ else
|
|
|
|
+ own_querier_enabled = true;
|
|
|
|
+ } else {
|
|
|
|
+ own_querier_enabled = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
return time_is_before_jiffies(querier->delay_time) &&
|
|
return time_is_before_jiffies(querier->delay_time) &&
|
|
- (br->multicast_querier || timer_pending(&querier->timer));
|
|
|
|
|
|
+ (own_querier_enabled || timer_pending(&querier->timer));
|
|
}
|
|
}
|
|
|
|
|
|
static inline bool br_multicast_querier_exists(struct net_bridge *br,
|
|
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,
|
|
{
|
|
{
|
|
switch (eth->h_proto) {
|
|
switch (eth->h_proto) {
|
|
case (htons(ETH_P_IP)):
|
|
case (htons(ETH_P_IP)):
|
|
- return __br_multicast_querier_exists(br, &br->ip4_other_query);
|
|
|
|
|
|
+ return __br_multicast_querier_exists(br,
|
|
|
|
+ &br->ip4_other_query, false);
|
|
#if IS_ENABLED(CONFIG_IPV6)
|
|
#if IS_ENABLED(CONFIG_IPV6)
|
|
case (htons(ETH_P_IPV6)):
|
|
case (htons(ETH_P_IPV6)):
|
|
- return __br_multicast_querier_exists(br, &br->ip6_other_query);
|
|
|
|
|
|
+ return __br_multicast_querier_exists(br,
|
|
|
|
+ &br->ip6_other_query, true);
|
|
#endif
|
|
#endif
|
|
default:
|
|
default:
|
|
return false;
|
|
return false;
|