Commit 576799a1 authored by Ad Schellevis's avatar Ad Schellevis

interfaces.php, vlan mtu, check with actual parent

parent 4ff07cad
...@@ -814,14 +814,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -814,14 +814,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
if (stristr($a_interfaces[$if]['if'], "_vlan")) { if (stristr($a_interfaces[$if]['if'], "_vlan")) {
$realhwif_array = get_parent_interface($a_interfaces[$if]['if']); $parentif = get_parent_interface($a_interfaces[$if]['if'])[0];
// Need code to handle MLPPP if we ever use $realhwif for MLPPP handling $intf_details = legacy_interfaces_details($parentif)[$parentif];
$parent_realhwif = $realhwif_array[0]; if ($intf_details['mtu'] < $pconfig['mtu']) {
$parent_if = convert_real_interface_to_friendly_interface_name($parent_realhwif); $input_errors[] = gettext("MTU of a vlan should not be bigger than parent interface.");
if (!empty($parent_if) && !empty($config['interfaces'][$parent_if]['mtu'])) {
if ($pconfig['mtu'] > intval($config['interfaces'][$parent_if]['mtu'])) {
$input_errors[] = gettext("MTU of a vlan should not be bigger than parent interface.");
}
} }
} else { } else {
foreach ($config['interfaces'] as $idx => $ifdata) { foreach ($config['interfaces'] as $idx => $ifdata) {
......
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