]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vrrpd: close sockets on shutdown
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 13 Feb 2019 22:15:37 +0000 (22:15 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 17 May 2019 00:27:08 +0000 (00:27 +0000)
When shutting down a VRRP router, kill the sockets as well. Too
dangerous to try to reuse them.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vrrpd/vrrp.c

index 5dde98a0822e16f8a78c90c3469f5e29d2b7039c..cf0ab3d54b5b5523a447938acb8fe551744157f7 100644 (file)
@@ -1291,7 +1291,15 @@ static int vrrp_shutdown(struct vrrp_router *r)
                break;
        }
 
-       /* Transition to the Initialize state */
+       if (r->sock_rx > 0) {
+               close(r->sock_rx);
+               r->sock_rx = -1;
+       }
+       if (r->sock_tx > 0) {
+               close(r->sock_tx);
+               r->sock_tx = -1;
+       }
+
        vrrp_change_state(r, VRRP_STATE_INITIALIZE);
 
        r->is_active = false;