Skip to content

Commit

Permalink
Use a local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
murrant committed Dec 17, 2024
1 parent ceaea55 commit 363bd41
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions includes/html/pages/device/routing/bgp.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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';
Expand All @@ -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 = '<span class=list-large>' . \LibreNMS\Util\Url::overlibLink($link, $peer['bgpPeerIdentifierPretty'], \LibreNMS\Util\Url::graphTag($graph_array_zoom)) . '</span>';
$peeraddresslink = '<span class=list-large>' . \LibreNMS\Util\Url::overlibLink($link, $peerIdentifierIp->compressed(), \LibreNMS\Util\Url::graphTag($graph_array_zoom)) . '</span>';

if ($peer['bgpPeerLastErrorCode'] == 0 && $peer['bgpPeerLastErrorSubCode'] == 0) {
$last_error = $peer['bgpPeerLastErrorText'];
Expand Down

0 comments on commit 363bd41

Please sign in to comment.