interfaces: kill is_jumbo_capable()

Introduced in 2005 to separate good VLAN-capable driver from
the bad ones.  We wonder how relevant this is nowadays.

Breaks at least Xen where the driver fails to pass the host's
VLAN capabilities.

Discussed with: @adschellevis
This commit is contained in:
Franco Fichtner 2018-03-12 17:20:52 +01:00
parent d823cc7193
commit 33b3dabab3
4 changed files with 6 additions and 23 deletions

View File

@ -489,11 +489,9 @@ EOD;
} 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++;
}
}
@ -506,8 +504,7 @@ EOD;
$vlan['if'] = chop(fgets($fp));
if ($vlan['if']) {
if (!array_key_exists($vlan['if'], $iflist) or
!is_jumbo_capable($vlan['if'])) {
if (!array_key_exists($vlan['if'], $iflist)) {
printf("\nInvalid interface name '%s'\n", $vlan['if']);
continue;
}

View File

@ -4451,14 +4451,6 @@ function get_interface_mac($interface)
return $macinfo["macaddr"];
}
function is_jumbo_capable($iface)
{
$intf_details = legacy_interface_details(trim($iface));
return isset($intf_details['capabilities']) &&
in_array('vlan_mtu', $intf_details['capabilities']);
}
function get_vip_descr($ipaddress)
{
global $config;

View File

@ -155,10 +155,7 @@ include("head.inc");
$portlist[$lagg['laggif']] = $lagg;
}
}
foreach ($portlist as $ifn => $ifinfo):
if (!is_jumbo_capable($ifn)) {
continue;
}?>
foreach ($portlist as $ifn => $ifinfo): ?>
<option value="<?=$ifn;?>" <?=$ifn == $pconfig['if'] ? " selected=\"selected\"" : "";?>>
<?=htmlspecialchars($ifn);?> ( <?= !empty($ifinfo['mac']) ? $ifinfo['mac'] :"" ;?> )
</option>

View File

@ -174,10 +174,7 @@ include("head.inc");
$portlist[$lagg['laggif']] = $lagg;
}
}
foreach ($portlist as $ifn => $ifinfo):
if (!is_jumbo_capable($ifn)) {
continue;
}?>
foreach ($portlist as $ifn => $ifinfo): ?>
<option value="<?=$ifn;?>" <?=$ifn == $pconfig['if'] ? " selected=\"selected\"" : "";?>>
<?=htmlspecialchars($ifn);?>
( <?= !empty($ifinfo['mac']) ? $ifinfo['mac'] :"" ;?> )