]> git.99rst.org Git - openwrt-packages.git/commitdiff
batman-adv: use return instead of continue in the migration script
authorJosef Schlehofer <redacted>
Thu, 6 Aug 2026 10:41:23 +0000 (12:41 +0200)
committerJosef Schlehofer <redacted>
Tue, 18 Aug 2026 08:04:02 +0000 (10:04 +0200)
proto_batadv_to_batadv_hardif() uses continue to skip a section, but
there is no loop in the function itself. POSIX leaves continue
without an enclosing loop in the current function unspecified; ash
walks the dynamic call stack and lands on the loop inside
config_foreach, which happens to produce the intended behaviour.

Use return, which expresses the intent directly and does not depend
on how config_foreach is implemented.

Reported-by: openwrt-ai[bot]
Signed-off-by: Josef Schlehofer <redacted>
Co-authored-by: Claude Fable 5 <redacted>
net/batman-adv/files/etc/uci-defaults/99-migrate-batadv_hardif

index c74b7f9c62e58a12459eacd438adcdf5486980fa..509374a92c8a29cee8414abf084304ea84343072 100755 (executable)
@@ -17,7 +17,7 @@ proto_batadv_to_batadv_hardif() {
     config_get routing_algo "${section}" routing_algo
 
     if [ -z "$mesh" -o "${proto}" != "batadv" ]; then
-        continue
+        return
     fi
 
     uci set network."${section}".proto="batadv_hardif"
git clone https://git.99rst.org/PROJECT