Commit 3b1fbc40 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(legacy) work on https://github.com/opnsense/core/issues/572

fix mtu parent setting and add max-payload for pppoe

(cherry picked from commit 0953e762)
parent a7e8bb37
......@@ -1759,9 +1759,14 @@ EOD;
$mtus = !empty($ppp['mtu']) ? explode(',', $ppp['mtu']) : null;
if (empty($mtus[$pid])) {
$mtus[$pid] = !empty($ifcfg['mtu']) ? intval($ifcfg['mtu']) : "1492";
$mtus[$pid] = !empty($ifcfg['mtu']) ? intval($ifcfg['mtu']) : 1500;
}
if ($ppp['type'] == "pppoe" && $mtus[$pid] > 1500 ) {
// use pppoe max-payload if mtu we're about to set > 1492
$mpdconf_arr[] = "set pppoe max-payload " . ($mtus[$pid]-8);
} else {
$mpdconf_arr[] = "set link mtu " . ($mtus[$pid]-8);
}
$mpdconf_arr[] = "set link mtu {$mtus[$pid]}";
$mrus = !empty($ppp['mtu']) ? explode(',', $ppp['mru']) : null;
if (!empty($mrus[$pid])) {
$mpdconf_arr[] = "set link mru {$mrus[$pid]}";
......@@ -3100,8 +3105,8 @@ function interface_configure($interface = 'wan', $reloadall = false, $linkupeven
legacy_interface_mtu($realif, $wancfg['mtu']);
}
} else {
if ($wancfg['mtu'] != legacy_interface_stats($realif)['mtu']) {
legacy_interface_mtu($realif, $wancfg['mtu']);
if ($wancfg['mtu'] != legacy_interface_stats($realhwif)['mtu']) {
legacy_interface_mtu($realhwif, $wancfg['mtu']);
}
/* This case is needed when the parent of vlans is being configured */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment