summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-06-03 16:33:12 +0200
committerDonald Sharp <sharpd@nvidia.com>2022-07-21 14:27:35 +0200
commit580e37a3fae7362330ed98d7864fb4ca70cacdab (patch)
tree6b808ac2e57df784e9a654a62d7a1a1550fcaeff /ripd
parentospfd: Convert thread_cancel to THREAD_OFF (diff)
downloadfrr-580e37a3fae7362330ed98d7864fb4ca70cacdab.tar.xz
frr-580e37a3fae7362330ed98d7864fb4ca70cacdab.zip
ripd: Remove various macros that overlap THREAD_OFF
Let's just use THREAD_OFF consistently in the code base instead of each daemon having a special macro that needs to be looked at and remembered what it does. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_nb_rpcs.c4
-rw-r--r--ripd/rip_peer.c2
-rw-r--r--ripd/ripd.c44
-rw-r--r--ripd/ripd.h3
4 files changed, 25 insertions, 28 deletions
diff --git a/ripd/rip_nb_rpcs.c b/ripd/rip_nb_rpcs.c
index 52f2985cb..25641f2f7 100644
--- a/ripd/rip_nb_rpcs.c
+++ b/ripd/rip_nb_rpcs.c
@@ -64,8 +64,8 @@ static void clear_rip_route(struct rip *rip)
}
if (rinfo) {
- RIP_TIMER_OFF(rinfo->t_timeout);
- RIP_TIMER_OFF(rinfo->t_garbage_collect);
+ THREAD_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_garbage_collect);
listnode_delete(list, rinfo);
rip_info_free(rinfo);
}
diff --git a/ripd/rip_peer.c b/ripd/rip_peer.c
index 8febb436e..d3cee3de2 100644
--- a/ripd/rip_peer.c
+++ b/ripd/rip_peer.c
@@ -38,7 +38,7 @@ static struct rip_peer *rip_peer_new(void)
static void rip_peer_free(struct rip_peer *peer)
{
- RIP_TIMER_OFF(peer->t_timeout);
+ THREAD_OFF(peer->t_timeout);
XFREE(MTYPE_RIP_PEER, peer);
}
diff --git a/ripd/ripd.c b/ripd/ripd.c
index cc21c0bd6..e1793b082 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -144,7 +144,7 @@ static void rip_garbage_collect(struct thread *t)
rinfo = THREAD_ARG(t);
/* Off timeout timer. */
- RIP_TIMER_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_timeout);
/* Get route_node pointer. */
rp = rinfo->rp;
@@ -226,14 +226,14 @@ struct rip_info *rip_ecmp_replace(struct rip *rip, struct rip_info *rinfo_new)
if (tmp_rinfo == rinfo)
continue;
- RIP_TIMER_OFF(tmp_rinfo->t_timeout);
- RIP_TIMER_OFF(tmp_rinfo->t_garbage_collect);
+ THREAD_OFF(tmp_rinfo->t_timeout);
+ THREAD_OFF(tmp_rinfo->t_garbage_collect);
list_delete_node(list, node);
rip_info_free(tmp_rinfo);
}
- RIP_TIMER_OFF(rinfo->t_timeout);
- RIP_TIMER_OFF(rinfo->t_garbage_collect);
+ THREAD_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_garbage_collect);
memcpy(rinfo, rinfo_new, sizeof(struct rip_info));
if (rip_route_rte(rinfo)) {
@@ -262,12 +262,12 @@ struct rip_info *rip_ecmp_delete(struct rip *rip, struct rip_info *rinfo)
struct route_node *rp = rinfo->rp;
struct list *list = (struct list *)rp->info;
- RIP_TIMER_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_timeout);
if (listcount(list) > 1) {
/* Some other ECMP entries still exist. Just delete this entry.
*/
- RIP_TIMER_OFF(rinfo->t_garbage_collect);
+ THREAD_OFF(rinfo->t_garbage_collect);
listnode_delete(list, rinfo);
if (rip_route_rte(rinfo)
&& CHECK_FLAG(rinfo->flags, RIP_RTF_FIB))
@@ -313,7 +313,7 @@ static void rip_timeout(struct thread *t)
static void rip_timeout_update(struct rip *rip, struct rip_info *rinfo)
{
if (rinfo->metric != RIP_METRIC_INFINITY) {
- RIP_TIMER_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_timeout);
thread_add_timer(master, rip_timeout, rinfo, rip->timeout_time,
&rinfo->t_timeout);
}
@@ -659,8 +659,8 @@ static void rip_rte_process(struct rte *rte, struct sockaddr_in *from,
assert(newinfo.metric
!= RIP_METRIC_INFINITY);
- RIP_TIMER_OFF(rinfo->t_timeout);
- RIP_TIMER_OFF(rinfo->t_garbage_collect);
+ THREAD_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_garbage_collect);
memcpy(rinfo, &newinfo,
sizeof(struct rip_info));
rip_timeout_update(rip, rinfo);
@@ -1614,7 +1614,7 @@ void rip_redistribute_delete(struct rip *rip, int type, int sub_type,
RIP_TIMER_ON(rinfo->t_garbage_collect,
rip_garbage_collect,
rip->garbage_time);
- RIP_TIMER_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_timeout);
rinfo->flags |= RIP_RTF_CHANGED;
if (IS_RIP_DEBUG_EVENT)
@@ -2506,7 +2506,7 @@ static void rip_update(struct thread *t)
/* Triggered updates may be suppressed if a regular update is due by
the time the triggered update would be sent. */
- RIP_TIMER_OFF(rip->t_triggered_interval);
+ THREAD_OFF(rip->t_triggered_interval);
rip->trigger = 0;
/* Register myself. */
@@ -2553,7 +2553,7 @@ static void rip_triggered_update(struct thread *t)
int interval;
/* Cancel interval timer. */
- RIP_TIMER_OFF(rip->t_triggered_interval);
+ THREAD_OFF(rip->t_triggered_interval);
rip->trigger = 0;
/* Logging triggered update. */
@@ -2603,7 +2603,7 @@ void rip_redistribute_withdraw(struct rip *rip, int type)
rinfo->metric = RIP_METRIC_INFINITY;
RIP_TIMER_ON(rinfo->t_garbage_collect, rip_garbage_collect,
rip->garbage_time);
- RIP_TIMER_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_timeout);
rinfo->flags |= RIP_RTF_CHANGED;
if (IS_RIP_DEBUG_EVENT) {
@@ -2785,7 +2785,7 @@ void rip_event(struct rip *rip, enum rip_event event, int sock)
thread_add_read(master, rip_read, rip, sock, &rip->t_read);
break;
case RIP_UPDATE_EVENT:
- RIP_TIMER_OFF(rip->t_update);
+ THREAD_OFF(rip->t_update);
jitter = rip_update_jitter(rip->update_time);
thread_add_timer(master, rip_update, rip,
sock ? 2 : rip->update_time + jitter,
@@ -2915,8 +2915,8 @@ void rip_ecmp_disable(struct rip *rip)
if (tmp_rinfo == rinfo)
continue;
- RIP_TIMER_OFF(tmp_rinfo->t_timeout);
- RIP_TIMER_OFF(tmp_rinfo->t_garbage_collect);
+ THREAD_OFF(tmp_rinfo->t_timeout);
+ THREAD_OFF(tmp_rinfo->t_garbage_collect);
list_delete_node(list, node);
rip_info_free(tmp_rinfo);
}
@@ -3508,8 +3508,8 @@ static void rip_instance_disable(struct rip *rip)
rip_zebra_ipv4_delete(rip, rp);
for (ALL_LIST_ELEMENTS_RO(list, listnode, rinfo)) {
- RIP_TIMER_OFF(rinfo->t_timeout);
- RIP_TIMER_OFF(rinfo->t_garbage_collect);
+ THREAD_OFF(rinfo->t_timeout);
+ THREAD_OFF(rinfo->t_garbage_collect);
rip_info_free(rinfo);
}
list_delete(&list);
@@ -3521,9 +3521,9 @@ static void rip_instance_disable(struct rip *rip)
rip_redistribute_disable(rip);
/* Cancel RIP related timers. */
- RIP_TIMER_OFF(rip->t_update);
- RIP_TIMER_OFF(rip->t_triggered_update);
- RIP_TIMER_OFF(rip->t_triggered_interval);
+ THREAD_OFF(rip->t_update);
+ THREAD_OFF(rip->t_triggered_update);
+ THREAD_OFF(rip->t_triggered_interval);
/* Cancel read thread. */
thread_cancel(&rip->t_read);
diff --git a/ripd/ripd.h b/ripd/ripd.h
index f26dcd877..d26592dac 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -404,9 +404,6 @@ enum rip_event {
/* Macro for timer turn on. */
#define RIP_TIMER_ON(T,F,V) thread_add_timer (master, (F), rinfo, (V), &(T))
-/* Macro for timer turn off. */
-#define RIP_TIMER_OFF(X) thread_cancel(&(X))
-
#define RIP_OFFSET_LIST_IN 0
#define RIP_OFFSET_LIST_OUT 1
#define RIP_OFFSET_LIST_MAX 2