summaryrefslogtreecommitdiffstats
path: root/vrrpd/vrrp.c
diff options
context:
space:
mode:
Diffstat (limited to 'vrrpd/vrrp.c')
-rw-r--r--vrrpd/vrrp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 3f93ac441..4ab660591 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -97,9 +97,11 @@ static void vrrp_mac_set(struct ethaddr *mac, bool v6, uint8_t vrid)
*/
static void vrrp_recalculate_timers(struct vrrp_router *r)
{
+ uint16_t mdiadv = r->vr->version == 3 ? r->master_adver_interval
+ : r->vr->advertisement_interval;
uint16_t skm = (r->vr->version == 3) ? r->master_adver_interval : 100;
r->skew_time = ((256 - r->vr->priority) * skm) / 256;
- r->master_down_interval = (3 * r->master_adver_interval);
+ r->master_down_interval = 3 * mdiadv;
r->master_down_interval += r->skew_time;
}