From 06b0906aaef25fdfc47b5fdd8eb2437a98445db6 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Sun, 2 Oct 2016 08:25:48 +0100 Subject: [PATCH] fix: Fixed SQL query for bgpPeers check to remove stale sessions (#4697) --- includes/discovery/bgp-peers.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/bgp-peers.inc.php b/includes/discovery/bgp-peers.inc.php index 6edcfc14a0..cc1903f534 100644 --- a/includes/discovery/bgp-peers.inc.php +++ b/includes/discovery/bgp-peers.inc.php @@ -214,7 +214,7 @@ if ($config['enable_bgp']) { } // Delete removed peers - $sql = "SELECT * FROM bgpPeers WHERE device_id = '".$device['device_id']."' AND context_name = '".$device['context_name']."'"; + $sql = "SELECT * FROM bgpPeers WHERE device_id = '".$device['device_id']."' AND (context_name = '".$device['context_name']."' OR context_name IS NULL)"; foreach (dbFetchRows($sql) as $entry) { unset($exists);