Add MSS Clamping option for Essentials (closes #45)
authorSteven Barth <steven@midlink.org>
Tue, 27 Jan 2009 20:49:04 +0000 (20:49 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 27 Jan 2009 20:49:04 +0000 (20:49 +0000)
Rename "MSS correction" to the correct term "MSS Clamping" in Firewall
Automatically set "defaultroute" and "peerdns" when PPP is selected in
Essentials

17 files changed:
applications/luci-fw/luasrc/i18n/luci-fw.de.lua
applications/luci-fw/luasrc/i18n/luci-fw.de.xml
applications/luci-fw/luasrc/i18n/luci-fw.en.lua
applications/luci-fw/luasrc/i18n/luci-fw.en.xml
i18n/english/luasrc/i18n/admin-core.en.lua
i18n/english/luasrc/i18n/admin-core.en.xml
i18n/french/luasrc/i18n/admin-core.fr.lua
i18n/french/luasrc/i18n/admin-core.fr.xml
i18n/german/luasrc/i18n/admin-core.de.lua
i18n/german/luasrc/i18n/admin-core.de.xml
i18n/italian/luasrc/i18n/admin-core.it.lua
i18n/italian/luasrc/i18n/admin-core.it.xml
i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua
i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml
i18n/russian/luasrc/i18n/admin-core.ru.lua
i18n/russian/luasrc/i18n/admin-core.ru.xml
modules/admin-mini/luasrc/model/cbi/mini/network.lua

index c58bba7..9659839 100644 (file)
@@ -12,7 +12,7 @@ fw_fw1 = 'Die Firewall erstellt Netzwerkzonen über bestimmte Netzwerkschnittste
 fw_src = 'Quelle'
 fw_dest = 'Ziel'
 fw_traffic = 'Verkehrskontrolle'
 fw_src = 'Quelle'
 fw_dest = 'Ziel'
 fw_traffic = 'Verkehrskontrolle'
-fw_mtufix = 'MSS-Korrektur'
+fw_mtufix = 'MSS Clamping'
 fw_dropinvalid = 'Ungültige Pakete verwerfen'
 firewall_rule_src = 'Eingangszone'
 firewall_rule_dest = 'Ausgangszone'
 fw_dropinvalid = 'Ungültige Pakete verwerfen'
 firewall_rule_src = 'Eingangszone'
 firewall_rule_dest = 'Ausgangszone'
@@ -35,7 +35,7 @@ firewall_redirect_destport = 'Interner Port (optional)'
 firewall_redirect_destport_desc = 'Port od. Erster-Letzter Port'
 firewall_redirect_srcip = 'Quelladresse'
 firewall_redirect_srcmac = 'Quell-MAC-Adresse'
 firewall_redirect_destport_desc = 'Port od. Erster-Letzter Port'
 firewall_redirect_srcip = 'Quelladresse'
 firewall_redirect_srcmac = 'Quell-MAC-Adresse'
-fw_forwarding1 = 'An dieser Stelle kann festgelegt zwischen welchen Zonen Netzverkehr hin und her fließen kann. Es werden nur neue Verbindungen betrachtet. Pakete, die zu bereits bestehenden Verbindungen gehören werden automatisch akzeptiert. Bei gelegentlich auftretenden Verbindungsproblemen kann eine MSS-Korrektur helfen, ansonsten sollte dies aus Performancegründen deaktiviert bleiben.'
+fw_forwarding1 = 'An dieser Stelle kann festgelegt zwischen welchen Zonen Netzverkehr hin und her fließen kann. Es werden nur neue Verbindungen betrachtet. Pakete, die zu bereits bestehenden Verbindungen gehören werden automatisch akzeptiert. Bei gelegentlich auftretenden Verbindungsproblemen kann MSS Clamping helfen, ansonsten sollte dies aus Performancegründen deaktiviert bleiben.'
 firewall_forwarding_src = 'Eingang'
 firewall_forwarding_dest = 'Ausgang'
 firewall_defaults = 'Grundeinstellungen'
 firewall_forwarding_src = 'Eingang'
 firewall_forwarding_dest = 'Ausgang'
 firewall_defaults = 'Grundeinstellungen'
index 265ac85..8578753 100644 (file)
@@ -16,7 +16,7 @@
 <i18n:msg xml:id="fw_src">Quelle</i18n:msg>
 <i18n:msg xml:id="fw_dest">Ziel</i18n:msg>
 <i18n:msg xml:id="fw_traffic">Verkehrskontrolle</i18n:msg>
 <i18n:msg xml:id="fw_src">Quelle</i18n:msg>
 <i18n:msg xml:id="fw_dest">Ziel</i18n:msg>
 <i18n:msg xml:id="fw_traffic">Verkehrskontrolle</i18n:msg>
-<i18n:msg xml:id="fw_mtufix">MSS-Korrektur</i18n:msg>
+<i18n:msg xml:id="fw_mtufix">MSS Clamping</i18n:msg>
 <i18n:msg xml:id="fw_dropinvalid">Ungültige Pakete verwerfen</i18n:msg>
 <i18n:msg xml:id="firewall_rule_src">Eingangszone</i18n:msg>
 <i18n:msg xml:id="firewall_rule_dest">Ausgangszone</i18n:msg>
 <i18n:msg xml:id="fw_dropinvalid">Ungültige Pakete verwerfen</i18n:msg>
 <i18n:msg xml:id="firewall_rule_src">Eingangszone</i18n:msg>
 <i18n:msg xml:id="firewall_rule_dest">Ausgangszone</i18n:msg>
@@ -42,7 +42,7 @@
 <i18n:msg xml:id="firewall_redirect_srcmac">Quell-MAC-Adresse</i18n:msg>
 
 
 <i18n:msg xml:id="firewall_redirect_srcmac">Quell-MAC-Adresse</i18n:msg>
 
 
-<i18n:msg xml:id="fw_forwarding1">An dieser Stelle kann festgelegt zwischen welchen Zonen Netzverkehr hin und her fließen kann. Es werden nur neue Verbindungen betrachtet. Pakete, die zu bereits bestehenden Verbindungen gehören werden automatisch akzeptiert. Bei gelegentlich auftretenden Verbindungsproblemen kann eine MSS-Korrektur helfen, ansonsten sollte dies aus Performancegründen deaktiviert bleiben.</i18n:msg>
+<i18n:msg xml:id="fw_forwarding1">An dieser Stelle kann festgelegt zwischen welchen Zonen Netzverkehr hin und her fließen kann. Es werden nur neue Verbindungen betrachtet. Pakete, die zu bereits bestehenden Verbindungen gehören werden automatisch akzeptiert. Bei gelegentlich auftretenden Verbindungsproblemen kann MSS Clamping helfen, ansonsten sollte dies aus Performancegründen deaktiviert bleiben.</i18n:msg>
 <i18n:msg xml:id="firewall_forwarding_src">Eingang</i18n:msg>
 <i18n:msg xml:id="firewall_forwarding_dest">Ausgang</i18n:msg>
 
 <i18n:msg xml:id="firewall_forwarding_src">Eingang</i18n:msg>
 <i18n:msg xml:id="firewall_forwarding_dest">Ausgang</i18n:msg>
 
index b39443b..14bfa3c 100644 (file)
@@ -23,7 +23,7 @@ fw_drop = 'drop'
 fw_src = 'Source'
 fw_dest = 'Destination'
 fw_traffic = 'Traffic Control'
 fw_src = 'Source'
 fw_dest = 'Destination'
 fw_traffic = 'Traffic Control'
-fw_mtufix = 'MSS-Correction'
+fw_mtufix = 'MSS Clamping'
 fw_dropinvalid = 'Drop invalid packets'
 fw_portfw1 = 'Port forwarding allows to provide network services in the internal network to an external network.'
 firewall_redirect_src_desc = 'External Zone'
 fw_dropinvalid = 'Drop invalid packets'
 fw_portfw1 = 'Port forwarding allows to provide network services in the internal network to an external network.'
 firewall_redirect_src_desc = 'External Zone'
@@ -35,7 +35,7 @@ firewall_redirect_destip = 'Internal address'
 firewall_redirect_destip_desc = 'IP-Address'
 firewall_redirect_destport = 'Internal port (optional)'
 firewall_redirect_destport_desc = 'port or range as first-last'
 firewall_redirect_destip_desc = 'IP-Address'
 firewall_redirect_destport = 'Internal port (optional)'
 firewall_redirect_destport_desc = 'port or range as first-last'
-fw_forwarding1 = 'Here you can specify which network traffic is allowed to flow between network zones. Only new connections will be matched. Packets belonging to already open connections are automatically allowed to pass the firewall. If you experience occasional connection problems try enabling MSS-Correction otherwise disable it for performance reasons.'
+fw_forwarding1 = 'Here you can specify which network traffic is allowed to flow between network zones. Only new connections will be matched. Packets belonging to already open connections are automatically allowed to pass the firewall. If you experience occasional connection problems try enabling MSS Clamping otherwise disable it for performance reasons.'
 firewall_forwarding_src = 'Input'
 firewall_forwarding_dest = 'Output'
 firewall_defaults = 'Defaults'
 firewall_forwarding_src = 'Input'
 firewall_forwarding_dest = 'Output'
 firewall_defaults = 'Defaults'
index be4118e..72856e0 100644 (file)
@@ -27,7 +27,7 @@
 <i18n:msg xml:id="fw_src">Source</i18n:msg>
 <i18n:msg xml:id="fw_dest">Destination</i18n:msg>
 <i18n:msg xml:id="fw_traffic">Traffic Control</i18n:msg>
 <i18n:msg xml:id="fw_src">Source</i18n:msg>
 <i18n:msg xml:id="fw_dest">Destination</i18n:msg>
 <i18n:msg xml:id="fw_traffic">Traffic Control</i18n:msg>
-<i18n:msg xml:id="fw_mtufix">MSS-Correction</i18n:msg>
+<i18n:msg xml:id="fw_mtufix">MSS Clamping</i18n:msg>
 <i18n:msg xml:id="fw_dropinvalid">Drop invalid packets</i18n:msg>
 
 <i18n:msg xml:id="fw_portfw1">Port forwarding allows to provide network services in the internal network to an external network.</i18n:msg>
 <i18n:msg xml:id="fw_dropinvalid">Drop invalid packets</i18n:msg>
 
 <i18n:msg xml:id="fw_portfw1">Port forwarding allows to provide network services in the internal network to an external network.</i18n:msg>
@@ -41,7 +41,7 @@
 <i18n:msg xml:id="firewall_redirect_destport">Internal port (optional)</i18n:msg>
 <i18n:msg xml:id="firewall_redirect_destport_desc">port or range as first-last</i18n:msg>
 
 <i18n:msg xml:id="firewall_redirect_destport">Internal port (optional)</i18n:msg>
 <i18n:msg xml:id="firewall_redirect_destport_desc">port or range as first-last</i18n:msg>
 
-<i18n:msg xml:id="fw_forwarding1">Here you can specify which network traffic is allowed to flow between network zones. Only new connections will be matched. Packets belonging to already open connections are automatically allowed to pass the firewall. If you experience occasional connection problems try enabling MSS-Correction otherwise disable it for performance reasons.</i18n:msg>
+<i18n:msg xml:id="fw_forwarding1">Here you can specify which network traffic is allowed to flow between network zones. Only new connections will be matched. Packets belonging to already open connections are automatically allowed to pass the firewall. If you experience occasional connection problems try enabling MSS Clamping otherwise disable it for performance reasons.</i18n:msg>
 <i18n:msg xml:id="firewall_forwarding_src">Input</i18n:msg>
 <i18n:msg xml:id="firewall_forwarding_dest">Output</i18n:msg>
 
 <i18n:msg xml:id="firewall_forwarding_src">Input</i18n:msg>
 <i18n:msg xml:id="firewall_forwarding_dest">Output</i18n:msg>
 
index 3f2991c..e22b019 100644 (file)
@@ -329,3 +329,5 @@ hostnames_entries = 'Host entries'
 hostnames_hostname = 'Hostname'
 hostnames_address = 'IP address'
 luci_components = "LuCI Components"
 hostnames_hostname = 'Hostname'
 hostnames_address = 'IP address'
 luci_components = "LuCI Components"
+m_n_mssfix = "Clamp Segment Size"
+m_n_mssfix_desc = "Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs."
index 1040a17..23ab06e 100644 (file)
 <i18n:msg xml:id="hostnames_entries">Host entries</i18n:msg>
 <i18n:msg xml:id="hostnames_hostname">Hostname</i18n:msg>
 <i18n:msg xml:id="hostnames_address">IP address</i18n:msg>
 <i18n:msg xml:id="hostnames_entries">Host entries</i18n:msg>
 <i18n:msg xml:id="hostnames_hostname">Hostname</i18n:msg>
 <i18n:msg xml:id="hostnames_address">IP address</i18n:msg>
-
+<i18n:msg xml:id="m_n_mssfix">Clamp Segment Size</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix_desc">Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs.</i18n:msg>
 </i18n:msgs>
 </i18n:msgs>
index 06a2cd6..a4789a0 100644 (file)
@@ -323,3 +323,5 @@ hostnames_entries = 'Entrées d&#39;hôtes'
 hostnames_hostname = 'Nom d&#39;hôte'
 hostnames_address = 'Adresse IP'
 network_interface_encaps = 'PPPoA Encapsulation'
 hostnames_hostname = 'Nom d&#39;hôte'
 hostnames_address = 'Adresse IP'
 network_interface_encaps = 'PPPoA Encapsulation'
+m_n_mssfix = "Clamp Segment Size"
+m_n_mssfix_desc = "Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs."
index 9bf1e79..5629245 100644 (file)
 <i18n:msg xml:id="hostnames_hostname">Nom d'hôte</i18n:msg>
 <i18n:msg xml:id="hostnames_address">Adresse IP</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
 <i18n:msg xml:id="hostnames_hostname">Nom d'hôte</i18n:msg>
 <i18n:msg xml:id="hostnames_address">Adresse IP</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix">Clamp Segment Size</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix_desc">Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs.</i18n:msg>
+
 
 </i18n:msgs>
 
 </i18n:msgs>
index ee3cbef..842c695 100644 (file)
@@ -341,3 +341,5 @@ hostnames_entries = 'Host-Einträge'
 hostnames_hostname = 'Rechnername'
 hostnames_address = 'IP-Adresse'
 luci_components = "LuCI Komponenten"
 hostnames_hostname = 'Rechnername'
 hostnames_address = 'IP-Adresse'
 luci_components = "LuCI Komponenten"
+m_n_mssfix = "Segmentgrößen Clamping"
+m_n_mssfix_desc = "Behebt Probleme bei nicht erreichbaren Webseiten, Absenden von Formularen oder anderes unerwartetes Verhalten für einige ISPs."
index b3555ee..a522f1f 100644 (file)
 <i18n:msg xml:id="hostnames_hostname">Rechnername</i18n:msg>
 <i18n:msg xml:id="hostnames_address">IP-Adresse</i18n:msg>
 
 <i18n:msg xml:id="hostnames_hostname">Rechnername</i18n:msg>
 <i18n:msg xml:id="hostnames_address">IP-Adresse</i18n:msg>
 
+<i18n:msg xml:id="m_n_mssfix">Segmentgrößen Clamping</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix_desc">Behebt Probleme bei nicht erreichbaren Webseiten, Absenden von Formularen oder anderes unerwartetes Verhalten für einige ISPs.</i18n:msg>
+
 </i18n:msgs>
 </i18n:msgs>
index 67311cd..2a62788 100644 (file)
@@ -323,3 +323,5 @@ hostnames_entries = 'Campi host'
 hostnames_hostname = 'Hostname'
 hostnames_address = 'Indirizzo IP'
 network_interface_encaps = 'PPPoA Encapsulation'
 hostnames_hostname = 'Hostname'
 hostnames_address = 'Indirizzo IP'
 network_interface_encaps = 'PPPoA Encapsulation'
+m_n_mssfix = "Clamp Segment Size"
+m_n_mssfix_desc = "Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs."
index 82c5992..51f149b 100644 (file)
 <i18n:msg xml:id="hostnames_hostname">Hostname</i18n:msg>
 <i18n:msg xml:id="hostnames_address">Indirizzo IP</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
 <i18n:msg xml:id="hostnames_hostname">Hostname</i18n:msg>
 <i18n:msg xml:id="hostnames_address">Indirizzo IP</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix">Clamp Segment Size</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix_desc">Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs.</i18n:msg>
 
 </i18n:msgs>
 
 </i18n:msgs>
index e8e6f4b..585ba86 100644 (file)
@@ -323,3 +323,5 @@ hostnames_entries = 'Entrada do Host'
 hostnames_hostname = 'Hostname'
 hostnames_address = 'Endereço de IP'
 network_interface_encaps = 'PPPoA Encapsulation'
 hostnames_hostname = 'Hostname'
 hostnames_address = 'Endereço de IP'
 network_interface_encaps = 'PPPoA Encapsulation'
+m_n_mssfix = "Clamp Segment Size"
+m_n_mssfix_desc = "Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs."
index c2442c5..35d30d5 100644 (file)
 <i18n:msg xml:id="hostnames_hostname">Hostname</i18n:msg>
 <i18n:msg xml:id="hostnames_address">Endereço de IP</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
 <i18n:msg xml:id="hostnames_hostname">Hostname</i18n:msg>
 <i18n:msg xml:id="hostnames_address">Endereço de IP</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix">Clamp Segment Size</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix_desc">Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs.</i18n:msg>
 
 </i18n:msgs>
 
 </i18n:msgs>
index 4058646..4961495 100644 (file)
@@ -265,3 +265,5 @@ network_interface_err_desc = 'Перед. / Получ.'
 network_interface_fwzone = 'Создать / Добавить Файрвол-зону'
 network_interface_fwzone_desc = 'Этот интерфейс не принадлежит ни к одной Файрвол-зоне.'
 network_interface_encaps = 'PPPoA Encapsulation'
 network_interface_fwzone = 'Создать / Добавить Файрвол-зону'
 network_interface_fwzone_desc = 'Этот интерфейс не принадлежит ни к одной Файрвол-зоне.'
 network_interface_encaps = 'PPPoA Encapsulation'
+m_n_mssfix = "Clamp Segment Size"
+m_n_mssfix_desc = "Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs."
index a75818e..1de8bef 100644 (file)
 <i18n:msg xml:id="network_interface_fwzone">Создать / Добавить Файрвол-зону</i18n:msg>
 <i18n:msg xml:id="network_interface_fwzone_desc">Этот интерфейс не принадлежит ни к одной Файрвол-зоне.</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
 <i18n:msg xml:id="network_interface_fwzone">Создать / Добавить Файрвол-зону</i18n:msg>
 <i18n:msg xml:id="network_interface_fwzone_desc">Этот интерфейс не принадлежит ни к одной Файрвол-зоне.</i18n:msg>
 <i18n:msg xml:id="network_interface_encaps">PPPoA Encapsulation</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix">Clamp Segment Size</i18n:msg>
+<i18n:msg xml:id="m_n_mssfix_desc">Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs.</i18n:msg>
 
 </i18n:msgs>
 
 </i18n:msgs>
index d03e6a7..508bac1 100644 (file)
@@ -109,6 +109,16 @@ p:value("dhcp", translate("automatic", "automatic"))
 if has_pppoe then p:value("pppoe", "PPPoE") end
 if has_pptp  then p:value("pptp",  "PPTP")  end
 
 if has_pppoe then p:value("pppoe", "PPPoE") end
 if has_pptp  then p:value("pptp",  "PPTP")  end
 
+function p.write(self, section, value)
+       -- Always set defaultroute to PPP and use remote dns
+       -- Overwrite a bad variable behaviour in OpenWrt
+       if value == "pptp" or value == "pppoe" then
+               self.map:set(section, "peerdns", "1")
+               self.map:set(section, "defaultroute", "1")
+       end
+       return ListValue.write(self, section, value)
+end
+
 if not ( has_pppoe and has_pptp ) then
        p.description = translate("network_interface_prereq_mini")
 end
 if not ( has_pppoe and has_pptp ) then
        p.description = translate("network_interface_prereq_mini")
 end
@@ -137,6 +147,34 @@ pwd.password = true
 pwd:depends("proto", "pppoe")
 pwd:depends("proto", "pptp")
 
 pwd:depends("proto", "pppoe")
 pwd:depends("proto", "pptp")
 
+
+-- 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
+
 kea = s:option(Flag, "keepalive", translate("m_n_keepalive"))
 kea:depends("proto", "pppoe")
 kea:depends("proto", "pptp")
 kea = s:option(Flag, "keepalive", translate("m_n_keepalive"))
 kea:depends("proto", "pppoe")
 kea:depends("proto", "pptp")