diff options
author | Dirk Brenken <dev@brenken.org> | 2023-04-05 11:30:29 +0200 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2023-04-05 11:30:29 +0200 |
commit | 148759a5c51ea30bca2c66a4035cf0f6b966e6cb (patch) | |
tree | ee9ddf349d024b3133e43ffa12193642746711ba /applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js | |
parent | 2145121d4cf766e8ea3340e08f8bc76ba5c513fc (diff) |
luci-app-firewall: fix the IPv6 forwards/snats view
* corrects the view as IPv4 and IPv6 for rules where the family is 'any' and the IP not set (this fixes #9c55500), e.g. a forward rule like that:
config redirect 'adblock_lan53'
option name 'Adblock DNS (lan, 53)'
option src 'lan'
option proto 'tcp udp'
option src_dport '53'
option dest_port '53'
option target 'DNAT'
option family 'any'
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js')
-rw-r--r-- | applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js index 9c3d5e7a31..759c23e0d9 100644 --- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js +++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js @@ -32,8 +32,8 @@ function rule_proto_txt(s) { } : null; return fwtool.fmt(_('Forwarded %{ipv6?%{ipv4?<var>IPv4</var> and <var>IPv6</var>:<var>IPv6</var>}:<var>IPv4</var>}%{proto?, protocol %{proto#%{next?, }<var>%{item.name}</var>}}%{mark?, mark <var%{mark.inv? data-tooltip="Match fwmarks except %{mark.num}%{mark.mask? with mask %{mark.mask}}.":%{mark.mask? data-tooltip="Mask fwmark value with %{mark.mask} before compare."}}>%{mark.val}</var>}'), { - ipv4: (family == 'ipv4' || (!family && (sip.indexOf(':') == -1 && dip.indexOf(':') == -1 && rwip.indexOf(':') == -1))), - ipv6: (family == 'ipv6' || (!family && (sip.indexOf(':') != -1 || dip.indexOf(':') != -1 || rwip.indexOf(':') != -1))), + ipv4: (family == 'ipv4' || (!family && sip.indexOf(':') == -1 && dip.indexOf(':') == -1 && rwip.indexOf(':') == -1)), + ipv6: (family == 'ipv6' || (!family && (!sip || !dip || !rwip)) || (!family && (sip.indexOf(':') != -1 || dip.indexOf(':') != -1 || rwip.indexOf(':') != -1))), proto: proto, mark: f }); |