• Sven Eckelmann's avatar
    batman-adv: Fix duplicated OGMs on NETDEV_UP · 9e6b5648
    Sven Eckelmann authored
    The state of slave interfaces are handled differently depending on whether
    the interface is up or not. All active interfaces (IFF_UP) will transmit
    OGMs. But for B.A.T.M.A.N. IV, also non-active interfaces are scheduling
    (low TTL) OGMs on active interfaces. The code which setups and schedules
    the OGMs must therefore already be called when the interfaces gets added as
    slave interface and the transmit function must then check whether it has to
    send out the OGM or not on the specific slave interface.
    
    But the commit f0d97253 ("batman-adv: remove ogm_emit and ogm_schedule
    API calls") moved the setup code from the enable function to the activate
    function. The latter is called either when the added slave was already up
    when batadv_hardif_enable_interface processed the new interface or when a
    NETDEV_UP event was received for this slave interfac. As result, each
    NETDEV_UP would schedule a new OGM worker for the interface and thus OGMs
    would be send a lot more than expected.
    
    Fixes: f0d97253 ("batman-adv: remove ogm_emit and ogm_schedule API calls")
    Reported-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
    Tested-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
    Acked-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
    Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
    Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
    9e6b5648
bat_iv_ogm.c 78.4 KB