Skip to content

Commit

Permalink
interfaces: kill is_jumbo_capable()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fichtner committed Mar 12, 2018
1 parent d823cc7 commit 33b3dab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
11 changes: 4 additions & 7 deletions src/etc/inc/console.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}

Expand All @@ -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;
}
Expand Down
8 changes: 0 additions & 8 deletions src/etc/inc/interfaces.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/www/interfaces_qinq_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,7 @@ interface_qinq_configure($qinqentry);
$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>
Expand Down
5 changes: 1 addition & 4 deletions src/www/interfaces_vlan_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,7 @@ interface_configure($confif);
$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'] :"" ;?> )
Expand Down

0 comments on commit 33b3dab

Please sign in to comment.