Project

General

Profile

« Previous | Next » 

Revision 4da0767b

Added by Renato Botelho almost 7 years ago

Fix #8595

Implement MTU override option that allow client to force a bigger MTU
value than the one negotiated on LCP that is known to work.

View differences:

src/etc/inc/interfaces.inc
2199 2199
		$mpdconf .= <<<EOD
2200 2200
	set iface addrs 10.10.1.1 10.10.1.2
2201 2201

  
2202
EOD;
2203
	}
2204

  
2205
	if (isset($ppp['mtu-override']) &&
2206
	    !isset($ppp['pppoe-multilink-over-singlelink'])) {
2207
		/* Find the smaller MTU set on ports */
2208
		$mtu = $defaultmtu;
2209
		foreach ($ports as $pid => $port) {
2210
			if (empty($mtus[$pid])) {
2211
				$mtus[$pid] = $defaultmtu;
2212
			}
2213
			if ($type == "pppoe") {
2214
				if ($mtus[$pid] > (get_interface_mtu($port) - 8)) {
2215
					$mtus[$pid] = get_interface_mtu($port) - 8;
2216
				}
2217
			}
2218
			if ($mtu > $mtus[$pid]) {
2219
				$mtu = $mtus[$pid];
2220
			}
2221
		}
2222
		$mpdconf .= <<<EOD
2223
	set iface mtu {$mtu} override
2224

  
2202 2225
EOD;
2203 2226
	}
2204 2227

  
......
2296 2319
			}
2297 2320
		}
2298 2321
		if (!isset($ppp['pppoe-multilink-over-singlelink']) &&
2322
		    !isset($ppp['mtu-override']) &&
2299 2323
		    !($type == "pppoe" && $mtus[$pid] > 1492)) {
2300 2324
			// N.B. MTU for PPPoE with MTU > 1492 is set using pppoe max-payload - see below
2301 2325
			$mpdconf .= <<<EOD
......
2305 2329
		}
2306 2330

  
2307 2331
		if (!isset($ppp['pppoe-multilink-over-singlelink']) &&
2332
		    !isset($ppp['mtu-override']) &&
2308 2333
		    !empty($mrus[$pid])) {
2309 2334
			$mpdconf .= <<<EOD
2310 2335
	set link mru {$mrus[$pid]}
src/usr/local/www/interfaces_ppps_edit.php
103 103
	if (isset($a_ppps[$id]['pppoe-multilink-over-singlelink'])) {
104 104
		$pconfig['pppoe-multilink-over-singlelink'] = true;
105 105
	}
106
	if (isset($a_ppps[$id]['mtu-override'])) {
107
		$pconfig['mtu-override'] = true;
108
	}
106 109
	if (isset($a_ppps[$id]['vjcomp'])) {
107 110
		$pconfig['vjcomp'] = true;
108 111
	}
......
416 419
		$ppp['protocomp'] = $_POST['protocomp'] ? true : false;
417 420
		$ppp['pppoe-multilink-over-singlelink'] =
418 421
		    $_POST['pppoe-multilink-over-singlelink'] ? true : false;
422
		$ppp['mtu-override'] =
423
		    $_POST['mtu-override'] ? true : false;
419 424
		$ppp['vjcomp'] = $_POST['vjcomp'] ? true : false;
420 425
		$ppp['tcpmssfix'] = $_POST['tcpmssfix'] ? true : false;
421 426
		if (is_array($port_data['bandwidth'])) {
......
839 844
	$pconfig['pppoe-multilink-over-singlelink']
840 845
))->setHelp('Enable if the provider supports LCP multilink extensions over single link (will ignore MTU / MRU settings)');
841 846

  
847
$section->addInput(new Form_Checkbox(
848
	'mtu-override',
849
	'Force MTU',
850
	'Force MTU value to a known higher value',
851
	$pconfig['mtu-override']
852
))->setHelp('Overwrite the result of LCP negotiation with a known working higher value. WARNING: This option violates RFC 1661 and can break connectivity.');
853

  
842 854
// Display the Link parameters. We will hide this by default, then un-hide the selected ones on clicking 'Advanced'
843 855
$j = 0;
844 856
foreach ($linklist['list'] as $ifnm => $nm) {
......
953 965
			    (!$pconfig['shortseq']) &&
954 966
			    (!$pconfig['acfcomp']) &&
955 967
			    (!$pconfig['pppoe-multilink-over-singlelink']) &&
968
			    (!$pconfig['mtu-override']) &&
956 969
			    (!$pconfig['protocomp'])) {
957 970
				$showadv = false;
958 971
			} else {
......
985 998
		hideResetDisplay(!(showadvopts && pppoetype));
986 999
		hideInput('pppoe-reset-type', !(showadvopts && pppoetype));
987 1000
		hideCheckbox('pppoe-multilink-over-singlelink', !(showadvopts && pppoetype));
1001
		hideCheckbox('mtu-override', !(showadvopts && pppoetype));
988 1002

  
989 1003
		hideInterfaces();
990 1004

  

Also available in: Unified diff