diff options
Diffstat (limited to 'ospf6d/ospf6_flood.c')
| -rw-r--r-- | ospf6d/ospf6_flood.c | 76 |
1 files changed, 35 insertions, 41 deletions
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 6ac93d8984..8a8dcfcd20 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -13,10 +13,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with GNU Zebra; see the file COPYING. If not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; see the file COPYING; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include <zebra.h> @@ -112,8 +111,9 @@ ospf6_lsa_originate (struct ospf6_lsa *lsa) lsdb_self = ospf6_get_scoped_lsdb_self (lsa); ospf6_lsdb_add (ospf6_lsa_copy (lsa), lsdb_self); - lsa->refresh = thread_add_timer (master, ospf6_lsa_refresh, lsa, - OSPF_LS_REFRESH_TIME); + lsa->refresh = NULL; + thread_add_timer(master, ospf6_lsa_refresh, lsa, OSPF_LS_REFRESH_TIME, + &lsa->refresh); if (IS_OSPF6_DEBUG_LSA_TYPE (lsa->header->type) || IS_OSPF6_DEBUG_ORIGINATE_TYPE (lsa->header->type)) @@ -225,9 +225,11 @@ ospf6_install_lsa (struct ospf6_lsa *lsa) } monotime(&now); - if (! OSPF6_LSA_IS_MAXAGE (lsa)) - lsa->expire = thread_add_timer (master, ospf6_lsa_expire, lsa, - OSPF_LSA_MAXAGE + lsa->birth.tv_sec - now.tv_sec); + if (! OSPF6_LSA_IS_MAXAGE (lsa)) { + lsa->expire = NULL; + thread_add_timer(master, ospf6_lsa_expire, lsa, OSPF_LSA_MAXAGE + lsa->birth.tv_sec - now.tv_sec, + &lsa->expire); + } else lsa->expire = NULL; @@ -361,10 +363,8 @@ ospf6_flood_interface (struct ospf6_neighbor *from, zlog_debug ("Add retrans-list of this neighbor"); ospf6_increment_retrans_count (lsa); ospf6_lsdb_add (ospf6_lsa_copy (lsa), on->retrans_list); - if (on->thread_send_lsupdate == NULL) - on->thread_send_lsupdate = - thread_add_timer (master, ospf6_lsupdate_send_neighbor, - on, on->ospf6_if->rxmt_interval); + thread_add_timer(master, ospf6_lsupdate_send_neighbor, on, on->ospf6_if->rxmt_interval, + &on->thread_send_lsupdate); retrans_added++; } @@ -406,9 +406,8 @@ ospf6_flood_interface (struct ospf6_neighbor *from, (oi->type == OSPF_IFTYPE_POINTOPOINT)) { ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsupdate_list); - if (oi->thread_send_lsupdate == NULL) - oi->thread_send_lsupdate = - thread_add_event (master, ospf6_lsupdate_send_interface, oi, 0); + thread_add_event(master, ospf6_lsupdate_send_interface, oi, 0, + &oi->thread_send_lsupdate); } else { @@ -416,8 +415,9 @@ ospf6_flood_interface (struct ospf6_neighbor *from, for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) { THREAD_OFF (on->thread_send_lsupdate); - on->thread_send_lsupdate = - thread_add_event (master, ospf6_lsupdate_send_neighbor, on, 0); + on->thread_send_lsupdate = NULL; + thread_add_event(master, ospf6_lsupdate_send_neighbor, on, 0, + &on->thread_send_lsupdate); } } } @@ -577,9 +577,8 @@ ospf6_acknowledge_lsa_bdrouter (struct ospf6_lsa *lsa, int ismore_recent, zlog_debug ("Delayed acknowledgement (BDR & MoreRecent & from DR)"); /* Delayed acknowledgement */ ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list); - if (oi->thread_send_lsack == NULL) - oi->thread_send_lsack = - thread_add_timer (master, ospf6_lsack_send_interface, oi, 3); + thread_add_timer(master, ospf6_lsack_send_interface, oi, 3, + &oi->thread_send_lsack); } else { @@ -601,9 +600,8 @@ ospf6_acknowledge_lsa_bdrouter (struct ospf6_lsa *lsa, int ismore_recent, zlog_debug ("Delayed acknowledgement (BDR & Duplicate & ImpliedAck & from DR)"); /* Delayed acknowledgement */ ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list); - if (oi->thread_send_lsack == NULL) - oi->thread_send_lsack = - thread_add_timer (master, ospf6_lsack_send_interface, oi, 3); + thread_add_timer(master, ospf6_lsack_send_interface, oi, 3, + &oi->thread_send_lsack); } else { @@ -621,9 +619,8 @@ ospf6_acknowledge_lsa_bdrouter (struct ospf6_lsa *lsa, int ismore_recent, if (is_debug) zlog_debug ("Direct acknowledgement (BDR & Duplicate)"); ospf6_lsdb_add (ospf6_lsa_copy (lsa), from->lsack_list); - if (from->thread_send_lsack == NULL) - from->thread_send_lsack = - thread_add_event (master, ospf6_lsack_send_neighbor, from, 0); + thread_add_event(master, ospf6_lsack_send_neighbor, from, 0, + &from->thread_send_lsack); return; } @@ -665,9 +662,8 @@ ospf6_acknowledge_lsa_allother (struct ospf6_lsa *lsa, int ismore_recent, zlog_debug ("Delayed acknowledgement (AllOther & MoreRecent)"); /* Delayed acknowledgement */ ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list); - if (oi->thread_send_lsack == NULL) - oi->thread_send_lsack = - thread_add_timer (master, ospf6_lsack_send_interface, oi, 3); + thread_add_timer(master, ospf6_lsack_send_interface, oi, 3, + &oi->thread_send_lsack); return; } @@ -689,9 +685,8 @@ ospf6_acknowledge_lsa_allother (struct ospf6_lsa *lsa, int ismore_recent, if (is_debug) zlog_debug ("Direct acknowledgement (AllOther & Duplicate)"); ospf6_lsdb_add (ospf6_lsa_copy (lsa), from->lsack_list); - if (from->thread_send_lsack == NULL) - from->thread_send_lsack = - thread_add_event (master, ospf6_lsack_send_neighbor, from, 0); + thread_add_event(master, ospf6_lsack_send_neighbor, from, 0, + &from->thread_send_lsack); return; } @@ -828,9 +823,8 @@ ospf6_receive_lsa (struct ospf6_neighbor *from, /* a) Acknowledge back to neighbor (Direct acknowledgement, 13.5) */ ospf6_lsdb_add (ospf6_lsa_copy (new), from->lsack_list); - if (from->thread_send_lsack == NULL) - from->thread_send_lsack = - thread_add_event (master, ospf6_lsack_send_neighbor, from, 0); + thread_add_event(master, ospf6_lsack_send_neighbor, from, 0, + &from->thread_send_lsack); /* b) Discard */ ospf6_lsa_delete (new); @@ -912,7 +906,8 @@ ospf6_receive_lsa (struct ospf6_neighbor *from, zlog_debug ("Newer instance of the self-originated LSA"); zlog_debug ("Schedule reorigination"); } - new->refresh = thread_add_event (master, ospf6_lsa_refresh, new, 0); + new->refresh = NULL; + thread_add_event(master, ospf6_lsa_refresh, new, 0, &new->refresh); } return; @@ -932,7 +927,7 @@ ospf6_receive_lsa (struct ospf6_neighbor *from, } /* BadLSReq */ - thread_add_event (master, bad_lsreq, from, 0); + thread_add_event(master, bad_lsreq, from, 0, NULL); ospf6_lsa_delete (new); return; @@ -998,9 +993,8 @@ ospf6_receive_lsa (struct ospf6_neighbor *from, /* XXX, MinLSArrival check !? RFC 2328 13 (8) */ ospf6_lsdb_add (ospf6_lsa_copy (old), from->lsupdate_list); - if (from->thread_send_lsupdate == NULL) - from->thread_send_lsupdate = - thread_add_event (master, ospf6_lsupdate_send_neighbor, from, 0); + thread_add_event(master, ospf6_lsupdate_send_neighbor, from, 0, + &from->thread_send_lsupdate); ospf6_lsa_delete (new); return; } |
