summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-08-04 17:12:42 +0000
committerErmal <eri@pfsense.org>2010-08-04 17:12:42 +0000
commit4cea5cf8ab9b06ccd414a783c1b7cb40e5961bf4 (patch)
tree88c995a0aaf2d22d270725a6ac1c35db85ff8334
parent56a5a0ab898e9b0fd8ebbb1b90d8a17040bea48b (diff)
downloadpfsense-4cea5cf8ab9b06ccd414a783c1b7cb40e5961bf4.zip
pfsense-4cea5cf8ab9b06ccd414a783c1b7cb40e5961bf4.tar.gz
Resolves #599. Split mtu and mss fields in interfaces page so it is possible to set them differently.
-rw-r--r--etc/inc/filter.inc6
-rwxr-xr-xusr/local/www/interfaces.php20
2 files changed, 22 insertions, 4 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index dbe2b4d..159e1b6 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -404,8 +404,9 @@ function filter_generate_scrubing() {
if(isset($scrubcfg['virtual']))
continue;
/* set up MSS clamping */
- if($scrubcfg['mtu'] <> "" && is_numeric($scrubcfg['mtu']) && $scrubcfg['if'] != "pppoe" && $scrubcfg['if'] != "pptp")
- $mssclamp = "max-mss " . (intval($scrubcfg['mtu'] - 40));
+ if($scrubcfg['mss'] <> "" && is_numeric($scrubcfg['mss']) && $scrubcfg['if'] != "pppoe" && $scrubcfg['if'] != "pptp" &&
+ $scrubif['if'] != "l2tp")
+ $mssclamp = "max-mss " . (intval($scrubcfg['mss'] - 40));
else
$mssclamp = "";
/* configure no-df for linux nfs and others */
@@ -701,6 +702,7 @@ function filter_generate_optcfg_array() {
$oic['type'] = $oc['ipaddr'];
$oic['sn'] = get_interface_subnet($if);
$oic['mtu'] = empty($oc['mtu']) ? 1500 : $oc['mtu'];
+ $oic['mss'] = empty($oc['mss']) ? '' : $oc['mss'];
$oic['descr'] = $ifdetail;
$oic['sa'] = gen_subnet($oic['ip'], $oic['sn']);
$oic['nonat'] = $oc['nonat'];
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index 888aa02..67a6a81 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -212,6 +212,7 @@ $pconfig['blockpriv'] = isset($wancfg['blockpriv']);
$pconfig['blockbogons'] = isset($wancfg['blockbogons']);
$pconfig['spoofmac'] = $wancfg['spoofmac'];
$pconfig['mtu'] = $wancfg['mtu'];
+$pconfig['mss'] = $wancfg['mss'];
/* Wireless interface? */
if (isset($wancfg['wireless'])) {
@@ -434,6 +435,8 @@ if ($_POST) {
$input_errors[] = gettext("A valid MAC address must be specified.");
if ($_POST['mtu'] && ($_POST['mtu'] < 576))
$input_errors[] = gettext("The MTU must be greater than 576 bytes.");
+ if ($_POST['mss'] && ($_POST['mss'] < 576))
+ $input_errors[] = gettext("The MSS must be greater than 576 bytes.");
/* Wireless interface? */
if (isset($wancfg['wireless'])) {
$reqdfields = explode(" ", "mode ssid");
@@ -651,6 +654,11 @@ if ($_POST) {
} else {
$wancfg['mtu'] = $_POST['mtu'];
}
+ if (empty($_POST['mss'])) {
+ unset($wancfg['mss']);
+ } else {
+ $wancfg['mss'] = $_POST['mss'];
+ }
if (isset($wancfg['wireless'])) {
handle_wireless_post();
}
@@ -1052,10 +1060,18 @@ $types = array("none" => gettext("None"), "static" => gettext("Static"), "dhcp"
<td class="vtable">
<input name="mtu" type="text" class="formfld unknown" id="mtu" size="8" value="<?=htmlspecialchars($pconfig['mtu']);?>">
<br>
+ <?=gettext("If you leave this field blank, " .
+ "an MTU of 1500 bytes will be assumed"); ?>.
+ </td>
+ </tr>
+ <tr>
+ <td valign="top" class="vncell"><?=gettext("MSS"); ?></td>
+ <td class="vtable">
+ <input name="mss" type="text" class="formfld unknown" id="mss" size="8" value="<?=htmlspecialchars($pconfig['mss']);?>">
+ <br>
<?=gettext("If you enter a value in this field, then MSS clamping for " .
"TCP connections to the value entered above minus 40 (TCP/IP " .
- "header size) will be in effect. If you leave this field blank, " .
- "an MTU of 1500 bytes will be assumed"); ?>.
+ "header size) will be in effect."); ?>.
</td>
</tr>
<tr>
OpenPOWER on IntegriCloud