Fix #9548: Do not rely on VLANMTU flag

Do not consider VLAN capable only interfaces that have VLANMTU flag.
This flag is used to determine if that interface can do 1500 MTU even
with VLANG tag set.
This commit is contained in:
Renato Botelho 2019-05-27 13:43:58 -03:00
parent 1842cd9292
commit 08fe7601ef
3 changed files with 12 additions and 16 deletions

View File

@ -454,11 +454,9 @@ function vlan_setup() {
} else {
$vlan_capable = 0;
foreach ($iflist as $iface => $ifa) {
if (is_jumbo_capable($iface)) {
echo sprintf("% -8s%s%s\n", $iface, $ifa['mac'],
$ifa['up'] ? " (up)" : "");
$vlan_capable++;
}
echo sprintf("% -8s%s%s\n", $iface, $ifa['mac'],
$ifa['up'] ? " (up)" : "");
$vlan_capable++;
}
}
@ -471,9 +469,10 @@ function vlan_setup() {
$vlan['if'] = chop(fgets($fp));
if ($vlan['if']) {
if (!array_key_exists($vlan['if'], $iflist) ||
!is_jumbo_capable($vlan['if'])) {
printf(gettext('%1$sInvalid interface name \'%2$s\'%3$s'), "\n", $vlan['if'], "\n");
if (!array_key_exists($vlan['if'], $iflist)) {
printf(gettext(
'%1$sInvalid interface name \'%2$s\'%3$s'),
"\n", $vlan['if'], "\n");
continue;
}
} else {

View File

@ -241,9 +241,7 @@ function build_parent_list() {
$list = array();
foreach ($portlist as $ifn => $ifinfo) {
if (is_jumbo_capable($ifn)) {
$list[$ifn] = $ifn . ' (' . $ifinfo['mac'] . ')';
}
$list[$ifn] = $ifn . ' (' . $ifinfo['mac'] . ')';
}
return($list);

View File

@ -157,11 +157,10 @@ function build_interfaces_list() {
$list = array();
foreach ($portlist as $ifn => $ifinfo) {
if (is_jumbo_capable($ifn)) {
$list[$ifn] = $ifn . " (" . $ifinfo['mac'] . ")";
$iface = convert_real_interface_to_friendly_interface_name($ifn);
if (isset($iface) && strlen($iface) > 0)
$list[$ifn] .= " - $iface";
$list[$ifn] = $ifn . " (" . $ifinfo['mac'] . ")";
$iface = convert_real_interface_to_friendly_interface_name($ifn);
if (isset($iface) && strlen($iface) > 0) {
$list[$ifn] .= " - $iface";
}
}