fw4: skip not existing netdev names in flowtable device list master
authorJo-Philipp Wich <jo@mein.io>
Mon, 3 Jun 2024 14:49:40 +0000 (16:49 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 3 Jun 2024 14:49:40 +0000 (16:49 +0200)
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 <jo@mein.io>
root/usr/share/ucode/fw4.uc

index ffea2ebdd7b5466eceba8ba51b9759b4ca165646..2d77146809585edcb91bbf770fb1fad51f7be48b 100644 (file)
@@ -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));
                }