summaryrefslogtreecommitdiffstats
path: root/vrrpd
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-03-13 19:37:48 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 02:27:08 +0200
commit08671293e2d2017c91d66496c0a92033107d5adc (patch)
treeade57ca158b9517518bcba565e3fdf492fc419d7 /vrrpd
parentvrrpd: include auth fields in v2 packet (diff)
downloadfrr-08671293e2d2017c91d66496c0a92033107d5adc.tar.xz
frr-08671293e2d2017c91d66496c0a92033107d5adc.zip
vrrpd: fix v2 master_down_interval computation
VRRPv2 uses the configured advertisement interval to compute the master down timer, whereas VRRPv3 uses the one advertised by the master. Fix computation to use the configured in in v2. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd')
-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;
}