diff --git a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
index d7f70de517..ee8d36e0c6 100644
--- a/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
+++ b/applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/forwards.js
@@ -10,7 +10,7 @@
function rule_proto_txt(s, ctHelpers) {
var family = (uci.get('firewall', s, 'family') || '').toLowerCase().replace(/^(?:any|\*)$/, '');
- var dip = uci.get('firewall', s, 'dest_ip') || ''
+ var dip = uci.get('firewall', s, 'dest_ip') || '';
var proto = L.toArray(uci.get('firewall', s, 'proto')).filter(function(p) {
return (p != '*' && p != 'any' && p != 'all');
}).map(function(p) {
@@ -38,8 +38,8 @@ function rule_proto_txt(s, ctHelpers) {
} : null;
return fwtool.fmt(_('Incoming %{ipv6?%{ipv4?IPv4 and IPv6:IPv6}:IPv4}%{proto?, protocol %{proto#%{next?, }%{item.types?%{item.name}ICMP with types %{item.types#%{next?, }%{item}}:%{item.name}}}}%{mark?, mark %{mark.val}}%{helper?, helper %{helper.inv?%{helper.val}:%{helper.val}}}'), {
- ipv4: ((!family && (dip.indexOf(':') == -1)) || family == 'ipv4'),
- ipv6: ((!family && (dip.indexOf(':') != -1)) || family == 'ipv6'),
+ ipv4: ((!family && dip.indexOf(':') == -1) || family == 'ipv4'),
+ ipv6: ((!family && dip.indexOf(':') != -1) || (!family && !dip) || family == 'ipv6'),
proto: proto,
helper: h,
mark: f
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?IPv4 and IPv6:IPv6}:IPv4}%{proto?, protocol %{proto#%{next?, }%{item.name}}}%{mark?, mark %{mark.val}}'), {
- 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
});