diff --git a/includes/html/pages/device/routing/bgp.inc.php b/includes/html/pages/device/routing/bgp.inc.php index 8742d200db4e..9b51cfda52e7 100644 --- a/includes/html/pages/device/routing/bgp.inc.php +++ b/includes/html/pages/device/routing/bgp.inc.php @@ -122,7 +122,7 @@ unset($peerhost, $peername); // load the peer identifier into an object - $peer['bgpPeerIdentifierObject'] = IP::parse($peer['bgpPeerIdentifier'], true); + $peerIdentifierIp = IP::parse($peer['bgpPeerIdentifier'], true); if ($peer['bgpPeerState'] == 'established') { $col = 'green'; @@ -162,7 +162,7 @@ $query = 'SELECT * FROM ipv6_addresses AS A, ports AS I, devices AS D WHERE '; $query .= '(A.ipv6_address = ? AND I.port_id = A.port_id)'; $query .= ' AND D.device_id = I.device_id'; - $ipv6_host = dbFetchRow($query, [$peer['bgpPeerIdentifierObject']->uncompressed()]); + $ipv6_host = dbFetchRow($query, [$peerIdentifierIp->uncompressed()]); if ($ipv4_host) { $peerhost = $ipv4_host; @@ -201,9 +201,6 @@ // Build a list of valid AFI/SAFI for this peer } - // make ipv6 look pretty - $peer['bgpPeerIdentifierPretty'] = (string) $peer['bgpPeerIdentifierObject']; - // display overlib graphs $graph_array = []; $graph_array['type'] = 'bgp_updates'; @@ -225,7 +222,7 @@ $link_array['page'] = 'graphs'; unset($link_array['height'], $link_array['width'], $link_array['legend']); $link = \LibreNMS\Util\Url::generate($link_array); - $peeraddresslink = '' . \LibreNMS\Util\Url::overlibLink($link, $peer['bgpPeerIdentifierPretty'], \LibreNMS\Util\Url::graphTag($graph_array_zoom)) . ''; + $peeraddresslink = '' . \LibreNMS\Util\Url::overlibLink($link, $peerIdentifierIp->compressed(), \LibreNMS\Util\Url::graphTag($graph_array_zoom)) . ''; if ($peer['bgpPeerLastErrorCode'] == 0 && $peer['bgpPeerLastErrorSubCode'] == 0) { $last_error = $peer['bgpPeerLastErrorText'];