From ce050a87781e6747c21d7e16f51d6017a1fbeca6 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 8 Sep 2022 11:03:27 +0200 Subject: [PATCH] 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 --- root/usr/share/ucode/fw4.uc | 4 ++-- 1 file 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++; -- 2.30.2