summaryrefslogtreecommitdiff
path: root/scripts/lib/kdoc/kdoc_output.py
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2025-04-16 20:37:56 +0200
committerSimon Wunderlich <sw@simonwunderlich.de>2025-04-16 20:52:33 +0200
commit8772cc49e0b8ab782e475ce5ef659eedab601a09 (patch)
tree741cabdaf0b1b209d72aa6cc5c00c9319d0e0653 /scripts/lib/kdoc/kdoc_output.py
parent61f96e684edd28ca40555ec49ea1555df31ba619 (diff)
batman-adv: fix duplicate MAC address check
batadv_check_known_mac_addr() is both too lenient and too strict: - It is called from batadv_hardif_add_interface(), which means that it checked interfaces that are not used for batman-adv at all. Move it to batadv_hardif_enable_interface(). Also, restrict it to hardifs of the same mesh interface; different mesh interfaces should not interact at all. The batadv_check_known_mac_addr() argument is changed from `struct net_device` to `struct batadv_hard_iface` to achieve this. - The check only cares about hardifs in BATADV_IF_ACTIVE and BATADV_IF_TO_BE_ACTIVATED states, but interfaces in BATADV_IF_INACTIVE state should be checked as well, or the following steps will not result in a warning then they should: - Add two interfaces in down state with different MAC addresses to a mesh as hardifs - Change the MAC addresses so they conflict - Set interfaces to up state Now there will be two active hardifs with the same MAC address, but no warning. Fix by only ignoring hardifs in BATADV_IF_NOT_IN_USE state. The RCU lock can be dropped, as we're holding RTNL anyways when the function is called. Fixes: c6c8fea29769 ("net: Add batman-adv meshing protocol") Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'scripts/lib/kdoc/kdoc_output.py')
0 files changed, 0 insertions, 0 deletions