mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 05:33:42 +00:00
vrrpd: fix more timer bugs
* Fix overflow in skew time computation * Fix accidentally removed initial setting of advertisement interval Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
1d21789e16
commit
1485d9e525
@ -78,10 +78,9 @@ static void vrrp_update_times(struct vrrp_vrouter *vr,
|
|||||||
{
|
{
|
||||||
vr->advertisement_interval = advertisement_interval;
|
vr->advertisement_interval = advertisement_interval;
|
||||||
vr->master_adver_interval = master_adver_interval;
|
vr->master_adver_interval = master_adver_interval;
|
||||||
vr->skew_time = (256 - vr->priority) * vr->master_adver_interval;
|
vr->skew_time = ((256 - vr->priority) * master_adver_interval) / 256;
|
||||||
vr->skew_time /= 256;
|
vr->master_down_interval = (3 * master_adver_interval);
|
||||||
vr->master_down_interval = (3 * vr->master_adver_interval);
|
vr->master_down_interval += vr->skew_time;
|
||||||
vr->master_down_interval /= 256 + vr->skew_time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -141,6 +140,7 @@ struct vrrp_vrouter *vrrp_vrouter_create(struct interface *ifp, uint8_t vrid)
|
|||||||
vrrp_mac_set(&vr->vr_mac_v4, false, vrid);
|
vrrp_mac_set(&vr->vr_mac_v4, false, vrid);
|
||||||
vrrp_mac_set(&vr->vr_mac_v6, true, vrid);
|
vrrp_mac_set(&vr->vr_mac_v6, true, vrid);
|
||||||
vr->fsm.state = VRRP_STATE_INITIALIZE;
|
vr->fsm.state = VRRP_STATE_INITIALIZE;
|
||||||
|
vrrp_set_advertisement_interval(vr, VRRP_DEFAULT_ADVINT);
|
||||||
vrrp_reset_times(vr);
|
vrrp_reset_times(vr);
|
||||||
|
|
||||||
hash_get(vrrp_vrouters_hash, vr, hash_alloc_intern);
|
hash_get(vrrp_vrouters_hash, vr, hash_alloc_intern);
|
||||||
|
Loading…
Reference in New Issue
Block a user