luci-app-firewall: snats.js: fix rewrite IP validation for SNAT target
authorJo-Philipp Wich <jo@mein.io>
Sat, 22 Feb 2020 21:19:54 +0000 (22:19 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sat, 22 Feb 2020 21:20:17 +0000 (22:20 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-firewall/htdocs/luci-static/resources/view/firewall/snats.js

index 9efa1a7497dfe0179a08ee42ab96bbd9362b74b7..8a1d41e719748ea49141d142005cf1cf920e888e 100644 (file)
@@ -220,7 +220,7 @@ return L.view.extend({
                            a = this.formvalue(section_id),
                            p = port ? port[0].formvalue(section_id) : null;
 
-                       if ((a == null || a == '') && (p == null || p == ''))
+                       if ((a == null || a == '') && (p == null || p == '') && value == '')
                                return _('A rewrite IP must be specified!');
 
                        return true;