• Linus Lüssing's avatar
    batman-adv: mcast/TT: fix wrongly dropped or rerouted packets · e63e927d
    Linus Lüssing authored
    [ Upstream commit 7dda5b33 ]
    
    The unicast packet rerouting code makes several assumptions. For
    instance it assumes that there is always exactly one destination in the
    TT. This breaks for multicast frames in a unicast packets in several ways:
    
    For one thing if there is actually no TT entry and the destination node
    was selected due to the multicast tvlv flags it announced. Then an
    intermediate node will wrongly drop the packet.
    
    For another thing if there is a TT entry but the TTVN of this entry is
    newer than the originally addressed destination node: Then the
    intermediate node will wrongly redirect the packet, leading to
    duplicated multicast packets at a multicast listener and missing
    packets at other multicast listeners or multicast routers.
    
    Fixing this by not applying the unicast packet rerouting to batman-adv
    unicast packets with a multicast payload. We are not able to detect a
    roaming multicast listener at the moment and will just continue to send
    the multicast frame to both the new and old destination for a while in
    case of such a roaming multicast listener.
    
    Fixes: a73105b8 ("batman-adv: improved client announcement mechanism")
    Signed-off-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
    Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
    Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
    Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
    e63e927d
routing.c 37.2 KB