]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
batman-adv: clear current gateway during teardown
authorRuijie Li <ruijieli51@gmail.com>
Thu, 14 May 2026 08:13:25 +0000 (16:13 +0800)
committerSven Eckelmann <sven@narfation.org>
Thu, 14 May 2026 16:48:40 +0000 (18:48 +0200)
commita340a51ed801eab7bb454150c226323b865263cc
treeb2d15fe05bfec87752b8985be65103cd996673d5
parent9cd3f16c320bfdadd4509358122368deb56a5741
batman-adv: clear current gateway during teardown

batadv_gw_node_free() removes the gateway list entries during mesh teardown,
but it does not clear the currently selected gateway. This leaves stale
gateway state behind across cleanup and can break a later mesh recreation.

Clear bat_priv->gw.curr_gw before walking the gateway list so the selected
gateway reference is dropped as part of teardown.

Fixes: 2265c1410864 ("batman-adv: gateway election code refactoring")
Cc: stable@kernel.org
Reported-by: Yuan Tan <yuantan098@gmail.com>
Reported-by: Yifan Wu <yifanwucs@gmail.com>
Reported-by: Juefei Pu <tomapufckgml@gmail.com>
Reported-by: Xin Liu <bird@lzu.edu.cn>
Signed-off-by: Ruijie Li <ruijieli51@gmail.com>
Signed-off-by: Zhanpeng Li <lzhanpeng2025@lzu.edu.cn>
Signed-off-by: Ren Wei <n05ec@lzu.edu.cn>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/gateway_client.c