Commit e97c4f1d authored by Franco Fichtner's avatar Franco Fichtner

interfaces: fix a crash report

parent 6c6b8f1d
......@@ -4520,22 +4520,12 @@ function get_interface_mac($interface)
return $macinfo["macaddr"];
}
/****f* interfaces/is_jumbo_capable
* NAME
* is_jumbo_capable - Test if interface is jumbo frame capable. Useful for determining VLAN capability.
* INPUTS
* $int - string containing interface name
* RESULT
* boolean - true or false
******/
function is_jumbo_capable($iface)
{
$intf_details = legacy_interface_details(trim($iface));
if (in_array('vlan_mtu', $intf_details['capabilities'])) {
return true;
} else {
return false;
}
return isset($intf_details['capabilities']) &&
in_array('vlan_mtu', $intf_details['capabilities']);
}
function get_vip_descr($ipaddress)
......
......@@ -199,19 +199,21 @@ function legacy_interface_stats($ifs=null)
* @param $intf filter on interface name (empty for all)
* @return array list of interface specifics indexed by physical interface name
*/
function legacy_interfaces_details($intf=null)
function legacy_interfaces_details($intf = null)
{
$result = array();
if (!empty($intf)) {
$tmp_intf = escapeshellarg($intf);
} else {
$tmp_intf = "";
$tmp_intf = '';
}
$cmd = '/sbin/ifconfig -m ' . $tmp_intf;
exec($cmd . ' 2>&1', $ifconfig_data, $ret);
if ($ret) {
log_error('The command `' . $cmd . '\' failed to execute ' . implode(' ', $ifconfig_data) );
return array();
log_error('The command `' . $cmd . '\' failed to execute ' . implode(' ', $ifconfig_data));
return $result;
}
$current_interface = null;
......
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