summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-01-27 20:49:04 +0000
committerSteven Barth <steven@midlink.org>2009-01-27 20:49:04 +0000
commitc56307acc36a03966b45c55e6857d978bbac7f8c (patch)
tree073e6856ff25a4470f4c6987fbc5127cf72de23f
parentafd569dfcae999da3f241af4b9a226e2bd893e04 (diff)
Add MSS Clamping option for Essentials (closes #45)
Rename "MSS correction" to the correct term "MSS Clamping" in Firewall Automatically set "defaultroute" and "peerdns" when PPP is selected in Essentials
-rw-r--r--applications/luci-fw/luasrc/i18n/luci-fw.de.lua4
-rw-r--r--applications/luci-fw/luasrc/i18n/luci-fw.de.xml4
-rw-r--r--applications/luci-fw/luasrc/i18n/luci-fw.en.lua4
-rw-r--r--applications/luci-fw/luasrc/i18n/luci-fw.en.xml4
-rw-r--r--i18n/english/luasrc/i18n/admin-core.en.lua2
-rw-r--r--i18n/english/luasrc/i18n/admin-core.en.xml3
-rw-r--r--i18n/french/luasrc/i18n/admin-core.fr.lua2
-rw-r--r--i18n/french/luasrc/i18n/admin-core.fr.xml3
-rw-r--r--i18n/german/luasrc/i18n/admin-core.de.lua2
-rw-r--r--i18n/german/luasrc/i18n/admin-core.de.xml3
-rw-r--r--i18n/italian/luasrc/i18n/admin-core.it.lua2
-rw-r--r--i18n/italian/luasrc/i18n/admin-core.it.xml2
-rw-r--r--i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua2
-rw-r--r--i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml2
-rw-r--r--i18n/russian/luasrc/i18n/admin-core.ru.lua2
-rw-r--r--i18n/russian/luasrc/i18n/admin-core.ru.xml2
-rw-r--r--modules/admin-mini/luasrc/model/cbi/mini/network.lua38
17 files changed, 72 insertions, 9 deletions
diff --git a/applications/luci-fw/luasrc/i18n/luci-fw.de.lua b/applications/luci-fw/luasrc/i18n/luci-fw.de.lua
index c58bba7bd..9659839e6 100644
--- a/applications/luci-fw/luasrc/i18n/luci-fw.de.lua
+++ b/applications/luci-fw/luasrc/i18n/luci-fw.de.lua
@@ -12,7 +12,7 @@ fw_fw1 = 'Die Firewall erstellt Netzwerkzonen über bestimmte Netzwerkschnittste
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'
@@ -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'
-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'
diff --git a/applications/luci-fw/luasrc/i18n/luci-fw.de.xml b/applications/luci-fw/luasrc/i18n/luci-fw.de.xml
index 265ac8539..8578753eb 100644
--- a/applications/luci-fw/luasrc/i18n/luci-fw.de.xml
+++ b/applications/luci-fw/luasrc/i18n/luci-fw.de.xml
@@ -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_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>
@@ -42,7 +42,7 @@
<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>
diff --git a/applications/luci-fw/luasrc/i18n/luci-fw.en.lua b/applications/luci-fw/luasrc/i18n/luci-fw.en.lua
index b39443b10..14bfa3c31 100644
--- a/applications/luci-fw/luasrc/i18n/luci-fw.en.lua
+++ b/applications/luci-fw/luasrc/i18n/luci-fw.en.lua
@@ -23,7 +23,7 @@ fw_drop = 'drop'
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'
@@ -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'
-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'
diff --git a/applications/luci-fw/luasrc/i18n/luci-fw.en.xml b/applications/luci-fw/luasrc/i18n/luci-fw.en.xml
index be4118edd..72856e03d 100644
--- a/applications/luci-fw/luasrc/i18n/luci-fw.en.xml
+++ b/applications/luci-fw/luasrc/i18n/luci-fw.en.xml
@@ -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_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>
@@ -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="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>
diff --git a/i18n/english/luasrc/i18n/admin-core.en.lua b/i18n/english/luasrc/i18n/admin-core.en.lua
index 3f2991c29..e22b01917 100644
--- a/i18n/english/luasrc/i18n/admin-core.en.lua
+++ b/i18n/english/luasrc/i18n/admin-core.en.lua
@@ -329,3 +329,5 @@ hostnames_entries = 'Host entries'
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."
diff --git a/i18n/english/luasrc/i18n/admin-core.en.xml b/i18n/english/luasrc/i18n/admin-core.en.xml
index 1040a1726..23ab06ed5 100644
--- a/i18n/english/luasrc/i18n/admin-core.en.xml
+++ b/i18n/english/luasrc/i18n/admin-core.en.xml
@@ -329,5 +329,6 @@
<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>
diff --git a/i18n/french/luasrc/i18n/admin-core.fr.lua b/i18n/french/luasrc/i18n/admin-core.fr.lua
index 06a2cd6ac..a4789a035 100644
--- a/i18n/french/luasrc/i18n/admin-core.fr.lua
+++ b/i18n/french/luasrc/i18n/admin-core.fr.lua
@@ -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'
+m_n_mssfix = "Clamp Segment Size"
+m_n_mssfix_desc = "Fixes problems with unreachable websites, submitting forms or other unexpected behaviour for some ISPs."
diff --git a/i18n/french/luasrc/i18n/admin-core.fr.xml b/i18n/french/luasrc/i18n/admin-core.fr.xml
index 9bf1e798a..562924542 100644
--- a/i18n/french/luasrc/i18n/admin-core.fr.xml
+++ b/i18n/french/luasrc/i18n/admin-core.fr.xml
@@ -327,5 +327,8 @@
<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>
diff --git a/i18n/german/luasrc/i18n/admin-core.de.lua b/i18n/german/luasrc/i18n/admin-core.de.lua
index ee3cbefbf..842c6953b 100644
--- a/i18n/german/luasrc/i18n/admin-core.de.lua
+++ b/i18n/german/luasrc/i18n/admin-core.de.lua
@@ -341,3 +341,5 @@ hostnames_entries = 'Host-Einträge'
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."
diff --git a/i18n/german/luasrc/i18n/admin-core.de.xml b/i18n/german/luasrc/i18n/admin-core.de.xml
index b3555ee1f..a522f1f85 100644
--- a/i18n/german/luasrc/i18n/admin-core.de.xml
+++ b/i18n/german/luasrc/i18n/admin-core.de.xml
@@ -364,4 +364,7 @@
<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>
diff --git a/i18n/italian/luasrc/i18n/admin-core.it.lua b/i18n/italian/luasrc/i18n/admin-core.it.lua
index 67311cd92..2a627880c 100644
--- a/i18n/italian/luasrc/i18n/admin-core.it.lua
+++ b/i18n/italian/luasrc/i18n/admin-core.it.lua
@@ -323,3 +323,5 @@ hostnames_entries = 'Campi host'
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."
diff --git a/i18n/italian/luasrc/i18n/admin-core.it.xml b/i18n/italian/luasrc/i18n/admin-core.it.xml
index 82c59924a..51f149bcb 100644
--- a/i18n/italian/luasrc/i18n/admin-core.it.xml
+++ b/i18n/italian/luasrc/i18n/admin-core.it.xml
@@ -327,5 +327,7 @@
<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>
diff --git a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua
index e8e6f4b45..585ba860e 100644
--- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua
+++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.lua
@@ -323,3 +323,5 @@ hostnames_entries = 'Entrada do Host'
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."
diff --git a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml
index c2442c52a..35d30d5e9 100644
--- a/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml
+++ b/i18n/portuguese_brazilian/luasrc/i18n/admin-core.pt-br.xml
@@ -327,5 +327,7 @@
<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>
diff --git a/i18n/russian/luasrc/i18n/admin-core.ru.lua b/i18n/russian/luasrc/i18n/admin-core.ru.lua
index 4058646f6..4961495d5 100644
--- a/i18n/russian/luasrc/i18n/admin-core.ru.lua
+++ b/i18n/russian/luasrc/i18n/admin-core.ru.lua
@@ -265,3 +265,5 @@ network_interface_err_desc = 'Перед. / Получ.'
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."
diff --git a/i18n/russian/luasrc/i18n/admin-core.ru.xml b/i18n/russian/luasrc/i18n/admin-core.ru.xml
index a75818e0c..1de8befc6 100644
--- a/i18n/russian/luasrc/i18n/admin-core.ru.xml
+++ b/i18n/russian/luasrc/i18n/admin-core.ru.xml
@@ -270,5 +270,7 @@
<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>
diff --git a/modules/admin-mini/luasrc/model/cbi/mini/network.lua b/modules/admin-mini/luasrc/model/cbi/mini/network.lua
index d03e6a777..508bac155 100644
--- a/modules/admin-mini/luasrc/model/cbi/mini/network.lua
+++ b/modules/admin-mini/luasrc/model/cbi/mini/network.lua
@@ -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
+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
@@ -137,6 +147,34 @@ pwd.password = true
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")