+
+-- Allow user to set MSS correction here if the UCI firewall is installed
+-- This cures some cancer for providers with pre-war routers
+if luci.fs.access("/etc/config/firewall") then
+ mssfix = s:option(Flag, "_mssfix",
+ translate("m_n_mssfix"), translate("m_n_mssfix_desc"))
+ mssfix.rmempty = false
+
+ function mssfix.cfgvalue(self)
+ local value
+ m.uci:foreach("firewall", "forwarding", function(s)
+ if s.src == "lan" and s.dest == "wan" then
+ value = s.mtu_fix
+ end
+ end)
+ return value
+ end
+
+ function mssfix.write(self, section, value)
+ m.uci:foreach("firewall", "forwarding", function(s)
+ if s.src == "lan" and s.dest == "wan" then
+ m.uci:set("firewall", s[".name"], "mtu_fix", value)
+ m:chain("firewall")
+ end
+ end)
+ end
+end
+