summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich2022-09-08 09:03:27 +0000
committerJo-Philipp Wich2022-09-08 09:03:27 +0000
commitce050a87781e6747c21d7e16f51d6017a1fbeca6 (patch)
treec0650f2f80f3774bb502b0c15a6b479e07125fb4
parentf5fcdcf2c51f6f0a4b116c352000c4fe0523be77 (diff)
downloadfirewall4-ce050a87781e6747c21d7e16f51d6017a1fbeca6.tar.gz
fw4: fall back to device if l3_device is not available in ifstatus
If the l3_device ifstatus property of a referenced logical interface is unavailable, e.g. due to the logical interface being down, no jump rules to the related zone chains are emitted. This is a deviation from fw3 which fell back to the l2 device value in this case. Do the same in firewall4 to still produce matching rules in the majority of cases, even if the l3 device ends up being something else. Fixes: #10639 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r--root/usr/share/ucode/fw4.uc4
1 files changed, 2 insertions, 2 deletions
diff --git a/root/usr/share/ucode/fw4.uc b/root/usr/share/ucode/fw4.uc
index 766290e..a7837ed 100644
--- a/root/usr/share/ucode/fw4.uc
+++ b/root/usr/share/ucode/fw4.uc
@@ -541,7 +541,7 @@ return {
for (let ifc in ifaces.interface) {
let net = {
up: ifc.up,
- device: ifc.l3_device,
+ device: ifc.l3_device ?? ifc.device,
physdev: ifc.device,
zone: ifc.data?.zone
};
@@ -589,7 +589,7 @@ return {
...rulespec,
name: (rulespec.type != 'ipset') ? `ubus:${ifc.interface}[${ifc.proto}] ${rulespec.type || 'rule'} ${n}` : rulespec.name,
- device: rulespec.device || ifc.l3_device
+ device: rulespec.device ?? ifc.l3_device ?? ifc.device
});
n++;