Author: adrian.chadd
Date: Tue Feb 24 08:47:43 2009
New Revision: 13863

Modified:
    playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c

Log:
Modify the BGP core to pay attention to the withdraw/shutdown flags.

If the shutdown flag is clear, then routes are not cleared; the generation  
ID is simply bumped.

If the withdraw flag is clear, then routes are not withdrawn; they're  
simply masked as historical.



Modified: playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c
==============================================================================
--- playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c  (original)
+++ playpen/LUSCA_HEAD_bgp/libsqbgp/bgp_core.c  Tue Feb 24 08:47:43 2009
@@ -116,7 +116,10 @@
                        if (r) {
                                /* Now, we need to poke the RIB with our saved 
info */
                                for (i = 0; i < us.withdraw_cnt; i++) {
-                                       bgp_rib_del_net(&bi->rn, 
us.withdraw[i],  
us.withdraw_mask[i]);
+                                       if (bi->cfg.clear_rib_on_withdraw)
+                                               bgp_rib_del_net(&bi->rn, 
us.withdraw[i],  
us.withdraw_mask[i]);
+                                       else
+                                               (void) 
bgp_rib_mark_historical(&bi->rn,  
us.withdraw[i], us.withdraw_mask[i]);
                                }
                                for (i = 0; i < us.nlri_cnt; i++) {
                                        bgp_rib_add_net(&bi->rn, us.nlri[i], 
us.nlri_mask[i],  
us.aspaths[us.aspath_len - 1]);
@@ -189,8 +192,10 @@
        bi->state = BGP_IDLE;
        bi->lcl.hold_timer = bi->rem.hold_timer = -1;
        /* free prefixes */
-       bgp_rib_clean(&bi->rn);
-       /* ensure no as path entries exist in the hash! */
+       if (bi->cfg.clear_rib_on_shutdown)
+               bgp_rib_clean(&bi->rn);
+       else
+               bgp_rib_bump_genid(&bi->rn);
  }



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"lusca-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/lusca-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to