summaryrefslogtreecommitdiffstats
path: root/vrrpd
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-03-05 21:33:27 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 02:27:08 +0200
commita90edf08e3ccdfd466a3663f87abc59931a56e7f (patch)
tree4e1193647717dcb9096df1faf646a093f1ad9e09 /vrrpd
parentvtysh: don't sort vrrp interface config (diff)
downloadfrr-a90edf08e3ccdfd466a3663f87abc59931a56e7f.tar.xz
frr-a90edf08e3ccdfd466a3663f87abc59931a56e7f.zip
vrrpd: fix broken reads when reinitializing
When a VRRP router was shut down - either due to an administrative event, or its interface getting deleted, or some other reason - it was forgetting to cancel its read task. When it was started again, the read task was still around, and so it wasn't getting scheduled again with the new socket fd's. This caused our socket to queue ingress packets but never read them, resulting in the restarted router always electing itself to Master (since it wasn't listening to any other advertisements, even though the kernel was delivering them). The t_write cancellation call doesn't matter here, but I'm putting it in there because it doesn't hurt and this way I won't forget about it if it becomes necessary in the future. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd')
-rw-r--r--vrrpd/vrrp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 524619dfa..d4a6dfc95 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -1534,6 +1534,8 @@ static int vrrp_shutdown(struct vrrp_router *r)
/* Cancel all timers */
THREAD_OFF(r->t_adver_timer);
THREAD_OFF(r->t_master_down_timer);
+ THREAD_OFF(r->t_read);
+ THREAD_OFF(r->t_write);
if (r->sock_rx > 0) {
close(r->sock_rx);