]> git.puffer.fish Git - mirror/frr.git/commitdiff
ripngd: Remove various macros that overlap THREAD_OFF
authorDonald Sharp <sharpd@nvidia.com>
Fri, 3 Jun 2022 14:37:34 +0000 (10:37 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 21 Jul 2022 12:27:35 +0000 (08:27 -0400)
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>
ripngd/ripng_nb_rpcs.c
ripngd/ripng_peer.c
ripngd/ripngd.c
ripngd/ripngd.h

index 4dfe9d96409b64d2dcf887d230ae67122eaf4334..57a5f266884f78888310417e6d7a2ebff99c1de5 100644 (file)
@@ -66,8 +66,8 @@ static void clear_ripng_route(struct ripng *ripng)
                }
 
                if (rinfo) {
-                       RIPNG_TIMER_OFF(rinfo->t_timeout);
-                       RIPNG_TIMER_OFF(rinfo->t_garbage_collect);
+                       THREAD_OFF(rinfo->t_timeout);
+                       THREAD_OFF(rinfo->t_garbage_collect);
                        listnode_delete(list, rinfo);
                        ripng_info_free(rinfo);
                }
index 010fdda89ebb33e134682a352b19de0b96334e2e..b22be39761db4c36ebc8fe8bf9e070e427a7c25c 100644 (file)
@@ -43,7 +43,7 @@ static struct ripng_peer *ripng_peer_new(void)
 
 static void ripng_peer_free(struct ripng_peer *peer)
 {
-       RIPNG_TIMER_OFF(peer->t_timeout);
+       THREAD_OFF(peer->t_timeout);
        XFREE(MTYPE_RIPNG_PEER, peer);
 }
 
index e7d292869782042f547156c47bc87754216ba34a..a587d8c36d3b00654dbe3e2e55b9fc8304131c6a 100644 (file)
@@ -431,7 +431,7 @@ static void ripng_garbage_collect(struct thread *t)
        rinfo = THREAD_ARG(t);
 
        /* Off timeout timer. */
-       RIPNG_TIMER_OFF(rinfo->t_timeout);
+       THREAD_OFF(rinfo->t_timeout);
 
        /* Get route_node pointer. */
        rp = rinfo->rp;
@@ -518,14 +518,14 @@ struct ripng_info *ripng_ecmp_replace(struct ripng *ripng,
        /* Re-use the first entry, and delete the others. */
        for (ALL_LIST_ELEMENTS(list, node, nextnode, tmp_rinfo))
                if (tmp_rinfo != rinfo) {
-                       RIPNG_TIMER_OFF(tmp_rinfo->t_timeout);
-                       RIPNG_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);
                        ripng_info_free(tmp_rinfo);
                }
 
-       RIPNG_TIMER_OFF(rinfo->t_timeout);
-       RIPNG_TIMER_OFF(rinfo->t_garbage_collect);
+       THREAD_OFF(rinfo->t_timeout);
+       THREAD_OFF(rinfo->t_garbage_collect);
        memcpy(rinfo, rinfo_new, sizeof(struct ripng_info));
 
        if (ripng_route_rte(rinfo)) {
@@ -557,7 +557,7 @@ struct ripng_info *ripng_ecmp_delete(struct ripng *ripng,
        struct agg_node *rp = rinfo->rp;
        struct list *list = (struct list *)rp->info;
 
-       RIPNG_TIMER_OFF(rinfo->t_timeout);
+       THREAD_OFF(rinfo->t_timeout);
 
        if (rinfo->metric != RIPNG_METRIC_INFINITY)
                ripng_aggregate_decrement(rp, rinfo);
@@ -565,7 +565,7 @@ struct ripng_info *ripng_ecmp_delete(struct ripng *ripng,
        if (listcount(list) > 1) {
                /* Some other ECMP entries still exist. Just delete this entry.
                 */
-               RIPNG_TIMER_OFF(rinfo->t_garbage_collect);
+               THREAD_OFF(rinfo->t_garbage_collect);
                listnode_delete(list, rinfo);
                if (ripng_route_rte(rinfo)
                    && CHECK_FLAG(rinfo->flags, RIPNG_RTF_FIB))
@@ -611,7 +611,7 @@ static void ripng_timeout(struct thread *t)
 static void ripng_timeout_update(struct ripng *ripng, struct ripng_info *rinfo)
 {
        if (rinfo->metric != RIPNG_METRIC_INFINITY) {
-               RIPNG_TIMER_OFF(rinfo->t_timeout);
+               THREAD_OFF(rinfo->t_timeout);
                thread_add_timer(master, ripng_timeout, rinfo,
                                 ripng->timeout_time, &rinfo->t_timeout);
        }
@@ -1022,7 +1022,7 @@ void ripng_redistribute_delete(struct ripng *ripng, int type, int sub_type,
                                RIPNG_TIMER_ON(rinfo->t_garbage_collect,
                                               ripng_garbage_collect,
                                               ripng->garbage_time);
-                               RIPNG_TIMER_OFF(rinfo->t_timeout);
+                               THREAD_OFF(rinfo->t_timeout);
 
                                /* Aggregate count decrement. */
                                ripng_aggregate_decrement(rp, rinfo);
@@ -1061,7 +1061,7 @@ void ripng_redistribute_withdraw(struct ripng *ripng, int type)
                                RIPNG_TIMER_ON(rinfo->t_garbage_collect,
                                               ripng_garbage_collect,
                                               ripng->garbage_time);
-                               RIPNG_TIMER_OFF(rinfo->t_timeout);
+                               THREAD_OFF(rinfo->t_timeout);
 
                                /* Aggregate count decrement. */
                                ripng_aggregate_decrement(rp, rinfo);
@@ -2209,8 +2209,8 @@ void ripng_ecmp_disable(struct ripng *ripng)
                        /* Drop all other entries, except the first one. */
                        for (ALL_LIST_ELEMENTS(list, node, nextnode, tmp_rinfo))
                                if (tmp_rinfo != rinfo) {
-                                       RIPNG_TIMER_OFF(tmp_rinfo->t_timeout);
-                                       RIPNG_TIMER_OFF(
+                                       THREAD_OFF(tmp_rinfo->t_timeout);
+                                       THREAD_OFF(
                                                tmp_rinfo->t_garbage_collect);
                                        list_delete_node(list, node);
                                        ripng_info_free(tmp_rinfo);
@@ -2528,8 +2528,8 @@ static void ripng_instance_disable(struct ripng *ripng)
                                ripng_zebra_ipv6_delete(ripng, rp);
 
                        for (ALL_LIST_ELEMENTS_RO(list, listnode, rinfo)) {
-                               RIPNG_TIMER_OFF(rinfo->t_timeout);
-                               RIPNG_TIMER_OFF(rinfo->t_garbage_collect);
+                               THREAD_OFF(rinfo->t_timeout);
+                               THREAD_OFF(rinfo->t_garbage_collect);
                                ripng_info_free(rinfo);
                        }
                        list_delete(&list);
@@ -2548,9 +2548,9 @@ static void ripng_instance_disable(struct ripng *ripng)
        ripng_redistribute_disable(ripng);
 
        /* Cancel the RIPng timers */
-       RIPNG_TIMER_OFF(ripng->t_update);
-       RIPNG_TIMER_OFF(ripng->t_triggered_update);
-       RIPNG_TIMER_OFF(ripng->t_triggered_interval);
+       THREAD_OFF(ripng->t_update);
+       THREAD_OFF(ripng->t_triggered_update);
+       THREAD_OFF(ripng->t_triggered_interval);
 
        /* Cancel the read thread */
        thread_cancel(&ripng->t_read);
index 6bf687b02a6d86b92e0f36565bc72095e2780c12..ac2edc5b2c81879b91d21cf405def69a1a5a4740 100644 (file)
@@ -312,8 +312,6 @@ enum ripng_event {
 /* RIPng timer on/off macro. */
 #define RIPNG_TIMER_ON(T,F,V) thread_add_timer (master, (F), rinfo, (V), &(T))
 
-#define RIPNG_TIMER_OFF(T)  thread_cancel(&(T))
-
 #define RIPNG_OFFSET_LIST_IN  0
 #define RIPNG_OFFSET_LIST_OUT 1
 #define RIPNG_OFFSET_LIST_MAX 2