summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-02-13 22:15:37 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 00:27:08 +0000
commitb7dc1bbb31e015ada8ca23617dda5b61888d0a4f (patch)
treeb0c24ff2297702c2a19c3031151eee0e86a0dae3
parent00984df75ad2cb581d3acffac4aa2d1eb58b648d (diff)
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>
-rw-r--r--vrrpd/vrrp.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 5dde98a082..cf0ab3d54b 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -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;