diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-06-20 18:03:06 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-07 13:53:42 +0100 |
commit | b32d557a6eca10c1e1dc2f2ab83e201f53d134b4 (patch) | |
tree | 2cb47dd9aca4d52ebafce84826da2903e43ca6b2 /proto/ospf/iface.c | |
parent | ee528fbd5dc482ceece52832d4a8ea5a08251bfa (diff) |
OSPF: Update to new timers
Note that recurrent timers are currently limited to ~1 hour.
Diffstat (limited to 'proto/ospf/iface.c')
-rw-r--r-- | proto/ospf/iface.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/proto/ospf/iface.c b/proto/ospf/iface.c index d1f9365e..33ec21fb 100644 --- a/proto/ospf/iface.c +++ b/proto/ospf/iface.c @@ -263,13 +263,13 @@ ospf_iface_down(struct ospf_iface *ifa) ospf_neigh_sm(n, INM_KILLNBR); if (ifa->hello_timer) - tm_stop(ifa->hello_timer); + tm2_stop(ifa->hello_timer); if (ifa->poll_timer) - tm_stop(ifa->poll_timer); + tm2_stop(ifa->poll_timer); if (ifa->wait_timer) - tm_stop(ifa->wait_timer); + tm2_stop(ifa->wait_timer); ospf_flush2_lsa(p, &ifa->link_lsa); ospf_flush2_lsa(p, &ifa->net_lsa); @@ -396,15 +396,15 @@ ospf_iface_sm(struct ospf_iface *ifa, int event) { ospf_iface_chstate(ifa, OSPF_IS_WAITING); if (ifa->wait_timer) - tm_start(ifa->wait_timer, ifa->waitint); + tm2_start(ifa->wait_timer, ifa->waitint S); } } if (ifa->hello_timer) - tm_start(ifa->hello_timer, ifa->helloint); + tm2_start(ifa->hello_timer, ifa->helloint S); if (ifa->poll_timer) - tm_start(ifa->poll_timer, ifa->pollint); + tm2_start(ifa->poll_timer, ifa->pollint S); ospf_send_hello(ifa, OHS_HELLO, NULL); } @@ -494,13 +494,13 @@ ospf_iface_add(struct object_lock *lock) if (! ifa->stub) { - ifa->hello_timer = tm_new_set(ifa->pool, hello_timer_hook, ifa, 0, ifa->helloint); + ifa->hello_timer = tm2_new_init(ifa->pool, hello_timer_hook, ifa, ifa->helloint S, 0); if (ifa->type == OSPF_IT_NBMA) - ifa->poll_timer = tm_new_set(ifa->pool, poll_timer_hook, ifa, 0, ifa->pollint); + ifa->poll_timer = tm2_new_init(ifa->pool, poll_timer_hook, ifa, ifa->pollint S, 0); if ((ifa->type == OSPF_IT_BCAST) || (ifa->type == OSPF_IT_NBMA)) - ifa->wait_timer = tm_new_set(ifa->pool, wait_timer_hook, ifa, 0, 0); + ifa->wait_timer = tm2_new_init(ifa->pool, wait_timer_hook, ifa, 0, 0); ifa->flood_queue_size = ifa_flood_queue_size(ifa); ifa->flood_queue = mb_allocz(ifa->pool, ifa->flood_queue_size * sizeof(void *)); @@ -703,7 +703,7 @@ ospf_iface_new_vlink(struct ospf_proto *p, struct ospf_iface_patt *ip) add_tail(&p->iface_list, NODE ifa); - ifa->hello_timer = tm_new_set(ifa->pool, hello_timer_hook, ifa, 0, ifa->helloint); + ifa->hello_timer = tm2_new_init(ifa->pool, hello_timer_hook, ifa, ifa->helloint S, 0); ifa->flood_queue_size = ifa_flood_queue_size(ifa); ifa->flood_queue = mb_allocz(ifa->pool, ifa->flood_queue_size * sizeof(void *)); @@ -717,8 +717,8 @@ ospf_iface_change_timer(timer *tm, uint val) tm->recurrent = val S; - if (tm_active(tm)) - tm_start(tm, val); + if (tm2_active(tm)) + tm2_start(tm, val S); } static inline void @@ -801,8 +801,8 @@ ospf_iface_reconfigure(struct ospf_iface *ifa, struct ospf_iface_patt *new) ifname, ifa->waitint, new->waitint); ifa->waitint = new->waitint; - if (ifa->wait_timer && ifa->wait_timer->expires) - tm_start(ifa->wait_timer, ifa->waitint); + if (ifa->wait_timer && tm2_active(ifa->wait_timer)) + tm2_start(ifa->wait_timer, ifa->waitint S); } /* DEAD TIMER */ |