diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-02-21 01:09:01 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-02-21 01:09:01 +0000 |
commit | afb226bebd8350f8f6523f4692658b944bc2997f (patch) | |
tree | 4435ee62f31050298f98dca0fe157fb7c9ca7e34 /bgpd/bgp_nexthop.c | |
parent | 4528ffa280f93ce64213bd79311dc9d7b3c6a12f (diff) |
[bgpd] Record afi/safi in bgp_table. Serialise peer clear with FSM.
2006-02-21 Paul Jakma <paul.jakma@sun.com>
* bgpd.h: move the clear_node_queue to be peer specific.
Add a new peer status flag, PEER_STATUS_CLEARING.
* bgp_table.h: (struct bgp_table) Add fields to record afi,
safi of the table.
(bgp_table_init) Take afi and safi to create table for.
* bgp_table.c: (bgp_table_init) record the afi and safi.
* bgp_nexthop.c: Update all calls to bgp_table_init.
* bgp_vty.c: ditto.
* bgpd.c: ditto.
* bgp_fsm.c: (bgp_timer_set) dont bring up a session which is
clearing.
* bgp_route.c: (general) Update all bgp_table_init calls.
(bgp_process_{rsclient,main}) clear_node is serialised
via PEER_STATUS_CLEARING and fsm now.
(struct bgp_clear_node_queue) can be removed. struct bgp_node
can be the queue item data directly, as struct peer can be
kept in the new wq global user data and afi/safi can be
retrieved via bgp_node -> bgp_table.
(bgp_clear_route_node) fix to get peer via wq->spec.data,
afi/safi via bgp_node->bgp_table.
(bgp_clear_node_queue_del) no more item data to delete, only
unlock the bgp_node.
(bgp_clear_node_complete) only need to unset CLEARING flag
and unlock struct peer.
(bgp_clear_node_queue_init) queue attaches to struct peer
now. record peer name as queue name.
(bgp_clear_route_table) If queue transitions to active,
serialise clearing by setting PEER_STATUS_CLEARING rather
than plugging process queue, and lock peer while queue
active.
Update to pass only bgp_node as per-queue-item specific data.
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index ba1752fb..ea707ccb 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -1330,17 +1330,17 @@ bgp_scan_init () bgp_scan_interval = BGP_SCAN_INTERVAL_DEFAULT; bgp_import_interval = BGP_IMPORT_INTERVAL_DEFAULT; - cache1_table[AFI_IP] = bgp_table_init (); - cache2_table[AFI_IP] = bgp_table_init (); + cache1_table[AFI_IP] = bgp_table_init (AFI_IP, SAFI_UNICAST); + cache2_table[AFI_IP] = bgp_table_init (AFI_IP, SAFI_UNICAST); bgp_nexthop_cache_table[AFI_IP] = cache1_table[AFI_IP]; - bgp_connected_table[AFI_IP] = bgp_table_init (); + bgp_connected_table[AFI_IP] = bgp_table_init (AFI_IP, SAFI_UNICAST); #ifdef HAVE_IPV6 - cache1_table[AFI_IP6] = bgp_table_init (); - cache2_table[AFI_IP6] = bgp_table_init (); + cache1_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST); + cache2_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST); bgp_nexthop_cache_table[AFI_IP6] = cache1_table[AFI_IP6]; - bgp_connected_table[AFI_IP6] = bgp_table_init (); + bgp_connected_table[AFI_IP6] = bgp_table_init (AFI_IP6, SAFI_UNICAST); #endif /* HAVE_IPV6 */ /* Make BGP scan thread. */ |