diff options
author | Donald Sharp <sharpd@nvidia.com> | 2021-10-04 15:36:27 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@nvidia.com> | 2021-10-04 15:36:54 +0200 |
commit | 64da2e8ecd842759511847a990274616dc05aade (patch) | |
tree | 437f166ccb31de9d2171c66f10b92381ce46ebc7 /ripd | |
parent | ripngd: Ensure better `struct thread *` semantics (diff) | |
download | frr-64da2e8ecd842759511847a990274616dc05aade.tar.xz frr-64da2e8ecd842759511847a990274616dc05aade.zip |
ripd: Ensure better `struct thread *` semantics
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 'ripd')
-rw-r--r-- | ripd/rip_interface.c | 1 | ||||
-rw-r--r-- | ripd/rip_peer.c | 1 | ||||
-rw-r--r-- | ripd/ripd.c | 12 |
3 files changed, 0 insertions, 14 deletions
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index a2c86e3b2..2eb7bb6da 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -805,7 +805,6 @@ static int rip_interface_wakeup(struct thread *t) ifp = THREAD_ARG(t); ri = ifp->info; - ri->t_wakeup = NULL; /* Join to multicast group. */ if (rip_multicast_join(ifp, ri->rip->sock) < 0) { diff --git a/ripd/rip_peer.c b/ripd/rip_peer.c index 63493e253..12c4edd43 100644 --- a/ripd/rip_peer.c +++ b/ripd/rip_peer.c @@ -95,7 +95,6 @@ static struct rip_peer *rip_peer_get(struct rip *rip, struct in_addr *addr) } /* Update timeout thread. */ - peer->t_timeout = NULL; thread_add_timer(master, rip_peer_timeout, peer, RIP_PEER_TIMER_DEFAULT, &peer->t_timeout); diff --git a/ripd/ripd.c b/ripd/ripd.c index 84fb67956..145b4de0a 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -142,7 +142,6 @@ static int rip_garbage_collect(struct thread *t) struct route_node *rp; rinfo = THREAD_ARG(t); - rinfo->t_garbage_collect = NULL; /* Off timeout timer. */ RIP_TIMER_OFF(rinfo->t_timeout); @@ -1744,7 +1743,6 @@ static int rip_read(struct thread *t) /* Fetch socket then register myself. */ sock = THREAD_FD(t); - rip->t_read = NULL; /* Add myself to tne next event */ rip_event(rip, RIP_READ, sock); @@ -2545,9 +2543,6 @@ static int rip_update(struct thread *t) { struct rip *rip = THREAD_ARG(t); - /* Clear timer pointer. */ - rip->t_update = NULL; - if (IS_RIP_DEBUG_EVENT) zlog_debug("update timer fire!"); @@ -2588,8 +2583,6 @@ static int rip_triggered_interval(struct thread *t) { struct rip *rip = THREAD_ARG(t); - rip->t_triggered_interval = NULL; - if (rip->trigger) { rip->trigger = 0; rip_triggered_update(t); @@ -2603,9 +2596,6 @@ static int rip_triggered_update(struct thread *t) struct rip *rip = THREAD_ARG(t); int interval; - /* Clear thred pointer. */ - rip->t_triggered_update = NULL; - /* Cancel interval timer. */ RIP_TIMER_OFF(rip->t_triggered_interval); rip->trigger = 0; @@ -2628,7 +2618,6 @@ static int rip_triggered_update(struct thread *t) update is triggered when the timer expires. */ interval = (frr_weak_random() % 5) + 1; - rip->t_triggered_interval = NULL; thread_add_timer(master, rip_triggered_interval, rip, interval, &rip->t_triggered_interval); @@ -2834,7 +2823,6 @@ void rip_event(struct rip *rip, enum rip_event event, int sock) switch (event) { case RIP_READ: - rip->t_read = NULL; thread_add_read(master, rip_read, rip, sock, &rip->t_read); break; case RIP_UPDATE_EVENT: |