[prev in list] [next in list] [prev in thread] [next in thread] 

List:       quagga-dev
Subject:    [quagga-dev 4653] [PATCH 5/6] [bgpd] V. quick route flap gets
From:       Paul Jakma <Paul.Jakma () Sun ! COM>
Date:       2007-04-08 23:57:33
Message-ID: Pine.LNX.4.64.0704090057250.2706 () localhost ! localdomain
[Download RAW message or body]

2007-04-08 Paul Jakma <paul.jakma@sun.com>

 	* bgp_route.c: (general) Same bug as fixed on 2006-11-28 by ajs for
 	  bgp static routes, but for main BGP RIB: Quick 'flap' of routes
 	  can cause bgpd to mistake a new route for a duplicate route,
 	  due to presence of removed, but not yet processed BGP RIB entry.
 	  (bgp_update_rsclient) Ignore REMOVED bgp_info for duplicate,
 	  restore route instead.
 	  (bgp_update_main) Ditto.
---
  bgpd/ChangeLog   |   10 ++++++++++
  bgpd/bgp_route.c |   23 ++++++++++++++++++++---
  2 files changed, 30 insertions(+), 3 deletions(-)

["159247c270d2c220f04a591fe28907d816236eb9.diff" (159247c270d2c220f04a591fe28907d816236eb9.diff)]

diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog

index fac0df9..653ce86 100644

--- a/bgpd/ChangeLog

+++ b/bgpd/ChangeLog

@@ -1,3 +1,13 @@

+2007-04-08 Paul Jakma <paul.jakma@sun.com>

+

+	* bgp_route.c: (general) Same bug as fixed on 2006-11-28 by ajs for

+	  bgp static routes, but for main BGP RIB: Quick 'flap' of routes

+	  can cause bgpd to mistake a new route for a duplicate route,

+	  due to presence of removed, but not yet processed BGP RIB entry.

+	  (bgp_update_rsclient) Ignore REMOVED bgp_info for duplicate,

+	  restore route instead.

+	  (bgp_update_main) Ditto.

+

 2007-04-07 Paul Jakma <paul.jakma@sun.com>

 

 	* bgpd.c: (general) Fix bug #352

diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c

index c464cd0..c33c596 100644

--- a/bgpd/bgp_route.c

+++ b/bgpd/bgp_route.c

@@ -1742,7 +1742,8 @@ bgp_update_rsclient (struct peer *rsclient, afi_t afi, safi_t \
safi,

       ri->uptime = time (NULL);

 

       /* Same attribute comes in. */

-      if (attrhash_cmp (ri->attr, attr_new))

+      if (!CHECK_FLAG(ri->flags, BGP_INFO_REMOVED)

+          && attrhash_cmp (ri->attr, attr_new))

         {

 

           bgp_info_unset_flag (rn, ri, BGP_INFO_ATTR_CHANGED);

@@ -1760,6 +1761,10 @@ bgp_update_rsclient (struct peer *rsclient, afi_t afi, safi_t \
safi,

                     return;

         }

 

+      /* Withdraw/Announce before we fully processed the withdraw */

+      if (CHECK_FLAG(ri->flags, BGP_INFO_REMOVED))

+        bgp_info_restore (rn, ri);

+      

       /* Received Logging. */

       if (BGP_DEBUG (update, UPDATE_IN))

         zlog (peer->log, LOG_DEBUG, "%s rcvd %s/%d for RS-client %s",

@@ -1987,7 +1992,8 @@ bgp_update_main (struct peer *peer, struct prefix *p, struct \
attr *attr,

       ri->uptime = time (NULL);

 

       /* Same attribute comes in. */

-      if (attrhash_cmp (ri->attr, attr_new))

+      if (!CHECK_FLAG (ri->flags, BGP_INFO_REMOVED) 

+          && attrhash_cmp (ri->attr, attr_new))

 	{

 	  bgp_info_unset_flag (rn, ri, BGP_INFO_ATTR_CHANGED);

 

@@ -2007,7 +2013,7 @@ bgp_update_main (struct peer *peer, struct prefix *p, struct \
attr *attr,

                   bgp_process (bgp, rn, afi, safi);

                 }

 	    }

-	  else

+          else /* Duplicate - odd */

 	    {

 	      if (BGP_DEBUG (update, UPDATE_IN))  

 		zlog (peer->log, LOG_DEBUG,

@@ -2029,6 +2035,17 @@ bgp_update_main (struct peer *peer, struct prefix *p, struct \
attr *attr,

 	  return 0;

 	}

 

+      /* Withdraw/Announce before we fully processed the withdraw */

+      if (CHECK_FLAG(ri->flags, BGP_INFO_REMOVED))

+        {

+          if (BGP_DEBUG (update, UPDATE_IN))

+            zlog (peer->log, LOG_DEBUG, "%s rcvd %s/%d, flapped quicker than \
processing",

+            peer->host,

+            inet_ntop(p->family, &p->u.prefix, buf, SU_ADDRSTRLEN),

+            p->prefixlen);

+          bgp_info_restore (rn, ri);

+        }

+

       /* Received Logging. */

       if (BGP_DEBUG (update, UPDATE_IN))  

 	zlog (peer->log, LOG_DEBUG, "%s rcvd %s/%d",

 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \
 \





_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
http://lists.quagga.net/mailman/listinfo/quagga-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic