From: Jo-Philipp Wich Date: Mon, 3 Jun 2024 14:49:40 +0000 (+0200) Subject: fw4: skip not existing netdev names in flowtable device list X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;p=project%2Ffirewall4.git fw4: skip not existing netdev names in flowtable device list In case interface configurations are present which refer to not existing network devices, such device names might end up in the flowtable list, leading to `No such file or directory` errors when attempting to load the resulting ruleset. Solve this issue by testing for each netdev name whether it refers to an existing device. Fixes: e009588 ("fw4: do not add physical devices for soft offload") Signed-off-by: Jo-Philipp Wich --- diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc index ffea2eb..2d77146 100644 --- a/root/usr/share/ucode/fw4.uc +++ b/root/usr/share/ucode/fw4.uc @@ -547,7 +547,9 @@ return { devices = []; for (let zone in this.zones()) - push(devices, ...zone.related_physdevs); + for (let device in zone.related_physdevs) + if (fs.access(`/sys/class/net/${device}`)) + push(devices, device); devices = sort(uniq(devices)); }