summaryrefslogtreecommitdiffstats
path: root/ldpd/neighbor.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-05-05 23:22:25 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-05-09 22:44:22 +0200
commit66e78ae64bc4659848517953b365606e3e70e878 (patch)
treeef1339e397feed2b56b8d653d41c03aa5b2bd94f /ldpd/neighbor.c
parentlib: safely check & set thread pointers (diff)
downloadfrr-66e78ae64bc4659848517953b365606e3e70e878.tar.xz
frr-66e78ae64bc4659848517953b365606e3e70e878.zip
*: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See previous commit message. To ensure that the behavior stays functionally correct, any assignments with the result of a thread_add* function have been transformed to set the pointer to null before passing it. These can be removed wherever the pointer is known to already be null. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'ldpd/neighbor.c')
-rw-r--r--ldpd/neighbor.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/ldpd/neighbor.c b/ldpd/neighbor.c
index 2eb46733e..f867db228 100644
--- a/ldpd/neighbor.c
+++ b/ldpd/neighbor.c
@@ -408,8 +408,8 @@ nbr_start_ktimer(struct nbr *nbr)
/* send three keepalives per period */
secs = nbr->keepalive / KEEPALIVE_PER_PERIOD;
THREAD_TIMER_OFF(nbr->keepalive_timer);
- nbr->keepalive_timer = thread_add_timer(master, nbr_ktimer, nbr, secs,
- NULL);
+ nbr->keepalive_timer = NULL;
+ thread_add_timer(master, nbr_ktimer, nbr, secs, &nbr->keepalive_timer);
}
void
@@ -438,8 +438,9 @@ static void
nbr_start_ktimeout(struct nbr *nbr)
{
THREAD_TIMER_OFF(nbr->keepalive_timeout);
- nbr->keepalive_timeout = thread_add_timer(master, nbr_ktimeout, nbr,
- nbr->keepalive, NULL);
+ nbr->keepalive_timeout = NULL;
+ thread_add_timer(master, nbr_ktimeout, nbr, nbr->keepalive,
+ &nbr->keepalive_timeout);
}
void
@@ -469,8 +470,8 @@ nbr_start_itimeout(struct nbr *nbr)
secs = INIT_FSM_TIMEOUT;
THREAD_TIMER_OFF(nbr->init_timeout);
- nbr->init_timeout = thread_add_timer(master, nbr_itimeout, nbr, secs,
- NULL);
+ nbr->init_timeout = NULL;
+ thread_add_timer(master, nbr_itimeout, nbr, secs, &nbr->init_timeout);
}
void
@@ -518,8 +519,9 @@ nbr_start_idtimer(struct nbr *nbr)
}
THREAD_TIMER_OFF(nbr->initdelay_timer);
- nbr->initdelay_timer = thread_add_timer(master, nbr_idtimer, nbr,
- secs, NULL);
+ nbr->initdelay_timer = NULL;
+ thread_add_timer(master, nbr_idtimer, nbr, secs,
+ &nbr->initdelay_timer);
}
void