vrrpd: close sockets on shutdown

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>
This commit is contained in:
Quentin Young 2019-02-13 22:15:37 +00:00
parent 00984df75a
commit b7dc1bbb31

View 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;