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]}

Also available in: Unified diff