From: Quentin Young Date: Wed, 13 Feb 2019 22:15:37 +0000 (+0000) Subject: vrrpd: close sockets on shutdown X-Git-Tag: base_7.2~330^2~79 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b7dc1bbb31e015ada8ca23617dda5b61888d0a4f;p=mirror%2Ffrr.git 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 --- 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;