diff --git a/includes/discovery/bgp-peers.inc.php b/includes/discovery/bgp-peers.inc.php index 2ac1b117d0..d3b4894a4d 100755 --- a/includes/discovery/bgp-peers.inc.php +++ b/includes/discovery/bgp-peers.inc.php @@ -129,7 +129,10 @@ if (isset($peerlist)) $j_peerIndexes[$ip] = $entry['jnxBgpM2PeerIndex']; break; case 'ipv6': - # FIXME not implemented yet + $ip6 = trim(str_replace(' ','',$entry['jnxBgpM2PeerRemoteAddr']),'"'); + $ip6 = substr($ip6,0,4) . ':' . substr($ip6,4,4) . ':' . substr($ip6,8,4) . ':' . substr($ip6,12,4) . ':' . substr($ip6,16,4) . ':' . substr($ip6,20,4) . ':' . substr($ip6,24,4) . ':' . substr($ip6,28,4); + $ip6 = Net_IPv6::compress($ip6); + $j_peerIndexes[$ip6] = $entry['jnxBgpM2PeerIndex']; break; default: echo("PANIC: Don't know RemoteAddrType " . $entry['jnxBgpM2PeerRemoteAddrType'] . "!\n"); diff --git a/includes/polling/bgp-peers.inc.php b/includes/polling/bgp-peers.inc.php index 84aeb73835..00e3993e3b 100755 --- a/includes/polling/bgp-peers.inc.php +++ b/includes/polling/bgp-peers.inc.php @@ -170,7 +170,10 @@ if ($device['os'] == "junos") $j_peerIndexes[$ip] = $entry['jnxBgpM2PeerIndex']; break; case 'ipv6': - # FIXME not implemented yet + $ip6 = trim(str_replace(' ','',$entry['jnxBgpM2PeerRemoteAddr']),'"'); + $ip6 = substr($ip6,0,4) . ':' . substr($ip6,4,4) . ':' . substr($ip6,8,4) . ':' . substr($ip6,12,4) . ':' . substr($ip6,16,4) . ':' . substr($ip6,20,4) . ':' . substr($ip6,24,4) . ':' . substr($ip6,28,4); + $ip6 = Net_IPv6::compress($ip6); + $j_peerIndexes[$ip6] = $entry['jnxBgpM2PeerIndex']; break; default: echo("PANIC: Don't know RemoteAddrType " . $entry['jnxBgpM2PeerRemoteAddrType'] . "!\n");