• Vladimir Oltean's avatar
    net: dsa: stop syncing the bridge mcast_router attribute at join time · 7df4e744
    Vladimir Oltean authored
    Qingfang points out that when a bridge with the default settings is
    created and a port joins it:
    
    ip link add br0 type bridge
    ip link set swp0 master br0
    
    DSA calls br_multicast_router() on the bridge to see if the br0 device
    is a multicast router port, and if it is, it enables multicast flooding
    to the CPU port, otherwise it disables it.
    
    If we look through the multicast_router_show() sysfs or at the
    IFLA_BR_MCAST_ROUTER netlink attribute, we see that the default mrouter
    attribute for the bridge device is "1" (MDB_RTR_TYPE_TEMP_QUERY).
    
    However, br_multicast_router() will return "0" (MDB_RTR_TYPE_DISABLED),
    because an mrouter port in the MDB_RTR_TYPE_TEMP_QUERY state may not be
    actually _active_ until it receives an actual IGMP query. So, the
    br_multicast_router() function should really have been called
    br_multicast_router_active() perhaps.
    
    When/if an IGMP query is received, the bridge device will transition via
    br_multicast_mark_router() into the active state until the
    ip4_mc_router_timer expires after an multicast_querier_interval.
    
    Of course, this does not happen if the bridge is created with an
    mcast_router attribute of "2" (MDB_RTR_TYPE_PERM).
    
    The point is that in lack of any IGMP query messages, and in the default
    bridge configuration, unregistered multicast packets will not be able to
    reach the CPU port through flooding, and this breaks many use cases
    (most obviously, IPv6 ND, with its ICMP6 neighbor solicitation multicast
    messages).
    
    Leave the multicast flooding setting towards the CPU port down to a driver
    level decision.
    
    Fixes: 010e269f ("net: dsa: sync up switchdev objects and port attributes when joining the bridge")
    Reported-by: default avatarDENG Qingfang <dqfext@gmail.com>
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7df4e744
port.c 30.5 KB