mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 08:09:41 +00:00
shell: use interfaces_primary_address6() for correct IPv6 display
This commit is contained in:
parent
afec5341ec
commit
6323cb793f
@ -86,15 +86,14 @@ foreach ($iflist as $ifname => $ifcfg) {
|
||||
|
||||
|
||||
$realif = get_real_interface($ifname);
|
||||
$realifv6 = get_real_interface($ifname, 'inet6');
|
||||
$network = null;
|
||||
$network6 = null;
|
||||
if (!empty($ifdetails[$realif]['ipv4'][0])) {
|
||||
$network = $ifdetails[$realif]['ipv4'][0]['ipaddr'] . "/" . $ifdetails[$realif]['ipv4'][0]['subnetbits'];
|
||||
}
|
||||
if (!empty($ifdetails[$realifv6]['ipv6'][0]) && empty($ifdetails[$realifv6]['ipv6'][0]['link-local'])) {
|
||||
$network6 = $ifdetails[$realifv6]['ipv6'][0]['ipaddr'] . "/" . $ifdetails[$realif]['ipv6'][0]['subnetbits'];
|
||||
}
|
||||
|
||||
list ($primary6, $unused, $subnet6) = interfaces_primary_address6($ifname, null, $ifdetails);
|
||||
$network6 = "{$primary6}/{$subnet6}";
|
||||
|
||||
$tobanner = "{$ifcfg['descr']} ({$realif})";
|
||||
|
||||
printf("\n %-15s -> ", $tobanner);
|
||||
@ -107,7 +106,7 @@ foreach ($iflist as $ifname => $ifcfg) {
|
||||
$v6first = true;
|
||||
}
|
||||
|
||||
if (!empty($network6)) {
|
||||
if ($network6 != '/') {
|
||||
if (!$v6first) {
|
||||
printf("\n%s", str_repeat(" ", 20));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user