This allows for address specifications like "fdca:1234:0123::abcd/::ffff:ffff:ffff:ffff"
which only match the last 64 bits of an address. This syntax is legal and already supported
by iptables and firewall3.
Fixes https://bugs.lede-project.org/index.php?do=details&task_id=417
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
translate("Source IP address"),
translate("Only match incoming traffic from this IP or range."))
o.rmempty = true
-o.datatype = "neg(ip4addr)"
+o.datatype = "neg(ipmask4)"
o.placeholder = translate("any")
luci.sys.net.ipv4_hints(function(ip, name)
o.rmempty = true
-o.datatype = "neg(ip4addr)"
+o.datatype = "neg(ipmask4)"
o.placeholder = translate("any")
o = s:option(Value, "dest_ip", translate("Internal IP address"),
translate("Redirect matched incoming traffic to the specified \
internal host"))
-o.datatype = "ip4addr"
+o.datatype = "ipmask4"
luci.sys.net.ipv4_hints(function(ip, name)
o:value(ip, "%s (%s)" %{ ip, name })
o = s:option(Value, "src_ip", translate("Source IP address"))
o.rmempty = true
- o.datatype = "neg(ipaddr)"
+ o.datatype = "neg(ipmask4)"
o.placeholder = translate("any")
luci.sys.net.ipv4_hints(function(ip, name)
o = s:option(Value, "dest_ip", translate("Destination IP address"))
- o.datatype = "neg(ip4addr)"
+ o.datatype = "neg(ipmask4)"
luci.sys.net.ipv4_hints(function(ip, name)
o:value(ip, "%s (%s)" %{ ip, name })
o = s:option(Value, "src_ip", translate("Source address"))
- o.datatype = "neg(ipaddr)"
+ o.datatype = "neg(ipmask)"
o.placeholder = translate("any")
luci.sys.net.ipv4_hints(function(ip, name)
o = s:option(Value, "dest_ip", translate("Destination address"))
- o.datatype = "neg(ipaddr)"
+ o.datatype = "neg(ipmask)"
o.placeholder = translate("any")
luci.sys.net.ipv4_hints(function(ip, name)
translate("Restrict Masquerading to given source subnets"))
msrc.optional = true
-msrc.datatype = "list(neg(or(uciname,hostname,ip4addr)))"
+msrc.datatype = "list(neg(or(uciname,hostname,ipmask4)))"
msrc.placeholder = "0.0.0.0/0"
msrc:depends("family", "")
msrc:depends("family", "ipv4")
translate("Restrict Masquerading to given destination subnets"))
mdest.optional = true
-mdest.datatype = "list(neg(or(uciname,hostname,ip4addr)))"
+mdest.datatype = "list(neg(or(uciname,hostname,ipmask4)))"
mdest.placeholder = "0.0.0.0/0"
mdest:depends("family", "")
mdest:depends("family", "ipv4")