Commit 31207371 authored by Ad Schellevis's avatar Ad Schellevis

(legacy) fix Undefined variable: smallermtu in /usr/local/etc/inc/interfaces.inc on line 593

parent 1923ee6c
...@@ -542,23 +542,22 @@ function interface_bridge_configure(&$bridge, $checkmember = 0) ...@@ -542,23 +542,22 @@ function interface_bridge_configure(&$bridge, $checkmember = 0)
} }
/* Calculate smaller mtu and enforce it */ /* Calculate smaller mtu and enforce it */
$mtu = 1500; $mtu = null;
$foundgif = false; $foundgif = false;
foreach ($members as $member) { foreach ($members as $member) {
$realif = get_real_interface($member); $realif = get_real_interface($member);
$opts = pfSense_get_interface_addresses($realif); $opts = pfSense_get_interface_addresses($realif);
$mtu = $opts['mtu'];
if (substr($realif, 0, 3) == "gif") { if (substr($realif, 0, 3) == "gif") {
$foundgif = true; $foundgif = true;
if ($checkmember == 1) { if ($checkmember == 1) {
return; return;
} }
if ($mtu <= 1500) { if ($opts['mtu'] <= 1500) {
continue; continue;
} }
} }
if (!empty($opts['mtu']) && $opts['mtu'] < $mtu) { if (!empty($opts['mtu']) && ($mtu == null || $opts['mtu'] < $mtu)) {
$mtu = $mtu = $opts['mtu']; $mtu = $opts['mtu'];
} }
} }
...@@ -590,7 +589,7 @@ function interface_bridge_configure(&$bridge, $checkmember = 0) ...@@ -590,7 +589,7 @@ function interface_bridge_configure(&$bridge, $checkmember = 0)
continue; continue;
} }
/* make sure the parent interface is up */ /* make sure the parent interface is up */
legacy_interface_mtu($realif, $smallermtu); legacy_interface_mtu($realif, $mtu);
legacy_interface_flags($realif, $flags); legacy_interface_flags($realif, $flags);
interfaces_bring_up($realif); interfaces_bring_up($realif);
legacy_bridge_member($bridge['bridgeif'], $realif); legacy_bridge_member($bridge['bridgeif'], $realif);
...@@ -790,11 +789,11 @@ function interface_lagg_configure(&$lagg) ...@@ -790,11 +789,11 @@ function interface_lagg_configure(&$lagg)
} }
/* Calculate smaller mtu and enforce it */ /* Calculate smaller mtu and enforce it */
$mtu = 1500; $mtu = null;
foreach ($members as $member) { foreach ($members as $member) {
$opts = pfSense_get_interface_addresses($member); $opts = pfSense_get_interface_addresses($member);
if (!empty($opts['mtu']) && $opts['mtu'] < $mtu) { if (!empty($opts['mtu']) && ($mtu == null || $opts['mtu'] < $mtu)) {
$smallermtu = $mtu; $mtu = $opts['mtu'];
} }
} }
......
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