Commit b676a002 authored by Ad Schellevis's avatar Ad Schellevis

(interfaces.lib.inc) regression, parse "inet6 2001:470:xxx:xxx::2 -->...

(interfaces.lib.inc) regression, parse "inet6 2001:470:xxx:xxx::2 --> 2001:470:xxx:xxx::1 prefixlen 128"
parent dcb6dc8a
...@@ -302,12 +302,16 @@ function _legacy_getall_interface_addresses($ifs) ...@@ -302,12 +302,16 @@ function _legacy_getall_interface_addresses($ifs)
break; break;
case 'inet6': case 'inet6':
$addr = strtok($stat[1], '%'); $addr = strtok($stat[1], '%');
$addrs['compat'][] = $addr . '/' . $stat[3];
if (!isset($addrs['ipaddr6']) && strpos($addr, 'fe80:') !== 0) { if (!isset($addrs['ipaddr6']) && strpos($addr, 'fe80:') !== 0) {
/* does not pick up link-local */ /* does not pick up link-local */
$addrs['ipaddr6'] = $addr; $addrs['ipaddr6'] = $addr;
$addrs['subnetbits6'] = intval($stat[3]); for ($i = 0; $i < count($stat); ++$i) {
if ($stat[$i] == 'prefixlen') {
$addrs['subnetbits6'] = intval($stat[$i+1]);
} }
}
}
$addrs['compat'][] = $addr . '/' . $addrs['subnetbits6'];
break; break;
case 'ether': case 'ether':
$addrs['macaddr'] = $stat[1]; $addrs['macaddr'] = $stat[1];
......
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