[quagga-dev 10332] [PATCH] bgp_nexthop.c : Check to prevent duplicate interface deletion from hash

Rakesh Garimella rakesh.garimella at sophos.com
Mon Mar 11 13:38:31 GMT 2013


  [PATCH] In bgp_nexthop.c
      * Added a check for duplicate address deletion

Signed-off-by: Rakesh Garimella <rakesh.garimella at sophos.com>
---
  bgpd/bgp_nexthop.c |    6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c
index d469236..8670628 100644
--- a/bgpd/bgp_nexthop.c
+++ b/bgpd/bgp_nexthop.c
@@ -604,6 +604,12 @@ bgp_address_del (struct prefix *p)
    tmp.addr = p->u.prefix4;

    addr = hash_lookup (bgp_address_hash, &tmp);
+/* A check to prevent duplicate address deletion from the hash when the 
interface is brought down
+ * before the bgp daemon is killed.
+ * when interface is down the interface is already deleted by 
bgp_interface_down() in bgp_zebra.c
+ * causing the hash_lookup to return NULL addr*/
+   if(addr == NULL)
+    return;
    addr->refcnt--;

    if (addr->refcnt == 0)
-- 
1.7.10.4

-- 
----
Rakesh Garimella | rakesh.garimella at sophos.com | Software Developer
Astaro Gmbh & Co. KG - a Sophos Company | www.astaro.com | www.sophos.com
Amalienbadstr, 41/Bau 52 | 76227, Karlsruhe | Germany

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20130311/96129467/attachment-0001.html>


More information about the Quagga-dev mailing list