summaryrefslogtreecommitdiffstats
path: root/ldpd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2022-07-18 15:42:23 +0200
committerDonatas Abraitis <donatas@opensourcerouting.org>2022-07-18 15:44:06 +0200
commit1f37d8c2d35cbe4ce347f7b5936d826890e97a8d (patch)
treefe3c4e379b42c4926df62eee8146ba57ae21d027 /ldpd
parentlib: Return 0 as remaining msec if the thread is not scheduled (diff)
downloadfrr-1f37d8c2d35cbe4ce347f7b5936d826890e97a8d.tar.xz
frr-1f37d8c2d35cbe4ce347f7b5936d826890e97a8d.zip
bgpd, ldpd: No need for an explicit NULL check for thread_timer_remain_second
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
Diffstat (limited to 'ldpd')
-rw-r--r--ldpd/adjacency.c4
-rw-r--r--ldpd/interface.c5
-rw-r--r--ldpd/neighbor.c7
3 files changed, 4 insertions, 12 deletions
diff --git a/ldpd/adjacency.c b/ldpd/adjacency.c
index 7eb566349..04a24242d 100644
--- a/ldpd/adjacency.c
+++ b/ldpd/adjacency.c
@@ -386,9 +386,7 @@ adj_to_ctl(struct adj *adj)
}
actl.holdtime = adj->holdtime;
actl.holdtime_remaining =
- thread_is_scheduled(adj->inactivity_timer)
- ? thread_timer_remain_second(adj->inactivity_timer)
- : 0;
+ thread_timer_remain_second(adj->inactivity_timer);
actl.trans_addr = adj->trans_addr;
actl.ds_tlv = adj->ds_tlv;
diff --git a/ldpd/interface.c b/ldpd/interface.c
index af6e8fd7e..ddf6c395a 100644
--- a/ldpd/interface.c
+++ b/ldpd/interface.c
@@ -543,11 +543,8 @@ ldp_sync_to_ctl(struct iface *iface)
ictl.wait_time = if_get_wait_for_sync_interval();
ictl.timer_running = iface->ldp_sync.wait_for_sync_timer ? true : false;
- if (iface->ldp_sync.wait_for_sync_timer)
- ictl.wait_time_remaining =
+ ictl.wait_time_remaining =
thread_timer_remain_second(iface->ldp_sync.wait_for_sync_timer);
- else
- ictl.wait_time_remaining = 0;
memset(&ictl.peer_ldp_id, 0, sizeof(ictl.peer_ldp_id));
diff --git a/ldpd/neighbor.c b/ldpd/neighbor.c
index 867ad92e4..514bcee32 100644
--- a/ldpd/neighbor.c
+++ b/ldpd/neighbor.c
@@ -847,11 +847,8 @@ nbr_to_ctl(struct nbr *nbr)
nctl.stats = nbr->stats;
nctl.flags = nbr->flags;
nctl.max_pdu_len = nbr->max_pdu_len;
- if (nbr->keepalive_timer)
- nctl.hold_time_remaining =
- thread_timer_remain_second(nbr->keepalive_timer);
- else
- nctl.hold_time_remaining = 0;
+ nctl.hold_time_remaining =
+ thread_timer_remain_second(nbr->keepalive_timer);
gettimeofday(&now, NULL);
if (nbr->state == NBR_STA_OPER) {