From dc4eb53a996a78bfb8ea07b47423ff5a3aadc362 Mon Sep 17 00:00:00 2001 From: Linus Lüssing Date: Sat, 7 Jun 2014 18:26:27 +0200 Subject: bridge: adhere to querier election mechanism specified by RFCs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit MLDv1 (RFC2710 section 6), MLDv2 (RFC3810 section 7.6.2), IGMPv2 (RFC2236 section 3) and IGMPv3 (RFC3376 section 6.6.2) specify that the querier with lowest source address shall become the selected querier. So far the bridge stopped its querier as soon as it heard another querier regardless of its source address. This results in the "wrong" querier potentially becoming the active querier or a potential, unnecessary querying delay. With this patch the bridge memorizes the source address of the currently selected querier and ignores queries from queriers with a higher source address than the currently selected one. This slight optimization is supposed to make it more RFC compliant (but is rather uncritical and therefore probably not necessary to be queued for stable kernels). Signed-off-by: Linus Lüssing Signed-off-by: David S. Miller --- net/bridge/br_private.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'net/bridge/br_private.h') diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 2469aeeda1ec..97c5e46dde72 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h @@ -78,6 +78,11 @@ struct bridge_mcast_other_query { struct timer_list timer; unsigned long delay_time; }; + +/* selected querier */ +struct bridge_mcast_querier { + struct br_ip addr; +}; #endif struct net_port_vlans { @@ -284,9 +289,11 @@ struct net_bridge struct timer_list multicast_router_timer; struct bridge_mcast_other_query ip4_other_query; struct bridge_mcast_own_query ip4_own_query; + struct bridge_mcast_querier ip4_querier; #if IS_ENABLED(CONFIG_IPV6) struct bridge_mcast_other_query ip6_other_query; struct bridge_mcast_own_query ip6_own_query; + struct bridge_mcast_querier ip6_querier; #endif /* IS_ENABLED(CONFIG_IPV6) */ #endif -- cgit v1.2.3