fw4: fix applying zone family restrictions to forwardings
authorJo-Philipp Wich <jo@mein.io>
Sat, 5 Feb 2022 23:30:41 +0000 (00:30 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sat, 5 Feb 2022 23:33:04 +0000 (00:33 +0100)
The source or destination zone family may be `null` instead of `0`, so
loosen the condition to cover both `0` and `null` values.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/ucode/fw4.uc

index 175883f85b254910dd409b03902afcd56a507411..fb8720859763633edf7ca4ba48d361f5eea672ad 100644 (file)
@@ -1993,9 +1993,9 @@ return {
                        let f1 = fwd.src.zone ? fwd.src.zone.family : 0;
                        let f2 = fwd.dest.zone ? fwd.dest.zone.family : 0;
 
-                       if (f1 != 0 && f2 != 0 && f1 != f2) {
+                       if (f1 && f2 && f1 != f2) {
                                this.warn_section(data,
-                                       sprintf("references src %s restricted to %s and dest restricted to %s, ignoring forwarding",
+                                       sprintf("references src %s restricted to %s and dest %s restricted to %s, ignoring forwarding",
                                                fwd.src.zone.name, this.nfproto(f1, true),
                                                fwd.dest.zone.name, this.nfproto(f2, true)));