make sure to unset $peerhost if no match, else will match previous entry in the table (durr)

git-svn-id: http://www.observium.org/svn/observer/trunk@733 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-01-27 21:54:33 +00:00
parent a3cd53e0ee
commit 754b13e381

View File

@@ -41,11 +41,12 @@ print_optionbar_end();
$query .= " AND D.device_id = I.device_id";
$ipv6_host = mysql_fetch_array(mysql_query($query));
if($ipv4_host) {
$peerhost = $ipv4_host;
} elseif($ipv6_host) {
$peerhost = $ipv6_host;
}
if($ipv4_host) {
$peerhost = $ipv4_host;
} elseif($ipv6_host) {
$peerhost = $ipv6_host;
} else { unset($peerhost); }
if($peerhost) {
$peername = generatedevicelink($peerhost);
} else {