Commit 6c6b8f1d authored by Franco Fichtner's avatar Franco Fichtner

interfaces: fix a crash report

There could be another error in here with the reported IPv6 issues...
parent e1733a01
......@@ -331,9 +331,14 @@ function legacy_getall_interface_addresses($ifs)
{
$result = array();
$intf_details = legacy_interface_details($ifs);
foreach (array("ipv4", "ipv6") as $proto) {
foreach (array('ipv4', 'ipv6') as $proto) {
if (empty($intf_details[$proto])) {
continue;
}
foreach ($intf_details[$proto] as $address) {
$result[] = $address['ipaddr'] . "/" . $address['subnetbits'];
if (!empty($address['ipaddr']) && !empty($address['subnetbits'])) {
$result[] = $address['ipaddr'] . '/' . $address['subnetbits'];
}
}
}
return $result;
......
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