]> git.proxmox.com Git - mirror_frr.git/commitdiff
vrrpd: stop session before nulling iface
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 21 Feb 2019 16:36:58 +0000 (16:36 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 17 May 2019 00:27:08 +0000 (00:27 +0000)
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>
vrrpd/vrrp.c

index e0f9b5286bfc4559e153dc50160a30038f66bf0d..92ed12e2391b6d7b08508e58656cc3077fbe4963 100644 (file)
@@ -1920,12 +1920,15 @@ void vrrp_if_del(struct interface *ifp)
        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);