summaryrefslogtreecommitdiff
path: root/vrrpd/vrrp.c
diff options
context:
space:
mode:
authorGhasem Naddaf <ghasem.naddaf@gmail.com>2019-10-16 15:47:12 -0700
committerGhasem Naddaf <ghasem.naddaf@gmail.com>2019-10-17 15:54:04 -0700
commitde7fe61e102e757d0bbdb8b78bfe434dc640589d (patch)
tree6d91a0c53a8a07ac581aeded04e062c52692e333 /vrrpd/vrrp.c
parent718804149e48bfc430f8b70bdd6c112effd04ebd (diff)
vrrpd: use CS2MS instead of constant 10 everywhere
Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com> vrrpd: use CS2MS instead of constant 10 everywhere Signed-off-by: Ghasem Naddaf <ghasem.naddaf@gmail.com>
Diffstat (limited to 'vrrpd/vrrp.c')
-rw-r--r--vrrpd/vrrp.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index b4049b55eb..819a06e99a 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -893,7 +893,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
THREAD_OFF(r->t_adver_timer);
thread_add_timer_msec(
master, vrrp_adver_timer_expire, r,
- r->vr->advertisement_interval * 10,
+ r->vr->advertisement_interval * CS2MS,
&r->t_adver_timer);
} else if (pkt->hdr.priority > r->priority
|| ((pkt->hdr.priority == r->priority)
@@ -913,7 +913,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
THREAD_OFF(r->t_master_down_timer);
thread_add_timer_msec(master,
vrrp_master_down_timer_expire, r,
- r->master_down_interval * 10,
+ r->master_down_interval * CS2MS,
&r->t_master_down_timer);
vrrp_change_state(r, VRRP_STATE_BACKUP);
} else {
@@ -931,7 +931,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
THREAD_OFF(r->t_master_down_timer);
thread_add_timer_msec(
master, vrrp_master_down_timer_expire, r,
- r->skew_time * 10, &r->t_master_down_timer);
+ r->skew_time * CS2MS, &r->t_master_down_timer);
} else if (r->vr->preempt_mode == false
|| pkt->hdr.priority >= r->priority) {
if (r->vr->version == 3) {
@@ -942,7 +942,7 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src,
THREAD_OFF(r->t_master_down_timer);
thread_add_timer_msec(master,
vrrp_master_down_timer_expire, r,
- r->master_down_interval * 10,
+ r->master_down_interval * CS2MS,
&r->t_master_down_timer);
} else if (r->vr->preempt_mode == true
&& pkt->hdr.priority < r->priority) {
@@ -1456,7 +1456,7 @@ static int vrrp_adver_timer_expire(struct thread *thread)
/* Reset the Adver_Timer to Advertisement_Interval */
thread_add_timer_msec(master, vrrp_adver_timer_expire, r,
- r->vr->advertisement_interval * 10,
+ r->vr->advertisement_interval * CS2MS,
&r->t_adver_timer);
} else {
zlog_err(VRRP_LOGPFX VRRP_LOGPFX_VRID VRRP_LOGPFX_FAM
@@ -1480,7 +1480,7 @@ static int vrrp_master_down_timer_expire(struct thread *thread)
r->vr->vrid, family2str(r->family));
thread_add_timer_msec(master, vrrp_adver_timer_expire, r,
- r->vr->advertisement_interval * 10,
+ r->vr->advertisement_interval * CS2MS,
&r->t_adver_timer);
vrrp_change_state(r, VRRP_STATE_MASTER);
@@ -1556,14 +1556,14 @@ static int vrrp_startup(struct vrrp_router *r)
if (r->priority == VRRP_PRIO_MASTER) {
thread_add_timer_msec(master, vrrp_adver_timer_expire, r,
- r->vr->advertisement_interval * 10,
+ r->vr->advertisement_interval * CS2MS,
&r->t_adver_timer);
vrrp_change_state(r, VRRP_STATE_MASTER);
} else {
r->master_adver_interval = r->vr->advertisement_interval;
vrrp_recalculate_timers(r);
thread_add_timer_msec(master, vrrp_master_down_timer_expire, r,
- r->master_down_interval * 10,
+ r->master_down_interval * CS2MS,
&r->t_master_down_timer);
vrrp_change_state(r, VRRP_STATE_BACKUP);
}