diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-10-04 15:28:36 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-10-04 15:28:36 +0200 |
commit | c733548963447f4383866f66117fd5e302d53baa (patch) | |
tree | 2320fb7eef4d8adf4dc097f4808d107953f557e6 /ripngd/ripngd.c | |
parent | Merge pull request #9714 from idryzhov/bgp-ext-comm-doc (diff) | |
download | frr-c733548963447f4383866f66117fd5e302d53baa.tar.xz frr-c733548963447f4383866f66117fd5e302d53baa.zip |
ripngd: Ensure better `struct thread *` semantics
1) Remove `struct thread *` pointers that are never used
2) Do not explicitly set the thread pointer to NULL.
FRR should only ever use the appropriate THREAD_ON/THREAD_OFF
semantics. This is espacially true for the functions we
end up calling the thread for.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ripngd/ripngd.c')
-rw-r--r-- | ripngd/ripngd.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 4f5c8e776..86abf1eea 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -429,7 +429,6 @@ static int ripng_garbage_collect(struct thread *t) struct agg_node *rp; rinfo = THREAD_ARG(t); - rinfo->t_garbage_collect = NULL; /* Off timeout timer. */ RIPNG_TIMER_OFF(rinfo->t_timeout); @@ -1320,7 +1319,6 @@ static int ripng_read(struct thread *thread) /* Fetch thread data and set read pointer to empty for event managing. `sock' sould be same as ripng->sock. */ sock = THREAD_FD(thread); - ripng->t_read = NULL; /* Add myself to the next event. */ ripng_event(ripng, RIPNG_READ, sock); @@ -1418,9 +1416,6 @@ static int ripng_update(struct thread *t) struct interface *ifp; struct ripng_interface *ri; - /* Clear update timer thread. */ - ripng->t_update = NULL; - /* Logging update event. */ if (IS_RIPNG_DEBUG_EVENT) zlog_debug("RIPng update timer expired!"); @@ -1469,8 +1464,6 @@ static int ripng_triggered_interval(struct thread *t) { struct ripng *ripng = THREAD_ARG(t); - ripng->t_triggered_interval = NULL; - if (ripng->trigger) { ripng->trigger = 0; ripng_triggered_update(t); @@ -1486,8 +1479,6 @@ int ripng_triggered_update(struct thread *t) struct ripng_interface *ri; int interval; - ripng->t_triggered_update = NULL; - /* Cancel interval timer. */ thread_cancel(&ripng->t_triggered_interval); ripng->trigger = 0; @@ -1525,7 +1516,6 @@ int ripng_triggered_update(struct thread *t) update is triggered when the timer expires. */ interval = (frr_weak_random() % 5) + 1; - ripng->t_triggered_interval = NULL; thread_add_timer(master, ripng_triggered_interval, ripng, interval, &ripng->t_triggered_interval); @@ -1942,7 +1932,6 @@ void ripng_event(struct ripng *ripng, enum ripng_event event, int sock) /* Update timer jitter. */ jitter = ripng_update_jitter(ripng->update_time); - ripng->t_update = NULL; thread_add_timer(master, ripng_update, ripng, sock ? 2 : ripng->update_time + jitter, &ripng->t_update); |