When an interface is deleted from the system, stop any attached VRRP
sessions before nulling out the interface fields.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vrrp_if_down(ifp);
for (ALL_LIST_ELEMENTS_RO(vrs, ln, vr)) {
- if (vr->ifp == ifp)
- vr->ifp = NULL;
- else if (vr->v4->mvl_ifp == ifp)
+ if ((vr->v4->mvl_ifp == ifp || vr->ifp == ifp)
+ && vr->v4->fsm.state != VRRP_STATE_INITIALIZE) {
+ vrrp_event(vr->v4, VRRP_EVENT_SHUTDOWN);
vr->v4->mvl_ifp = NULL;
- else if (vr->v6->mvl_ifp == ifp)
+ } else if ((vr->v6->mvl_ifp == ifp || vr->ifp == ifp)
+ && vr->v6->fsm.state != VRRP_STATE_INITIALIZE) {
+ vrrp_event(vr->v6, VRRP_EVENT_SHUTDOWN);
vr->v6->mvl_ifp = NULL;
+ }
}
list_delete(&vrs);