summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-10-20 14:59:30 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-10-20 15:04:25 +0200
commit4bb420ab81b8d9cc1e7f9cde4729392bd2b12f1d (patch)
tree4d0547ec4f1eff4df4865bd4a3701f7dc7f29198 /ospfd
parentMerge pull request #3203 from opensourcerouting/buildfoo-20181015 (diff)
downloadfrr-4bb420ab81b8d9cc1e7f9cde4729392bd2b12f1d.tar.xz
frr-4bb420ab81b8d9cc1e7f9cde4729392bd2b12f1d.zip
ospfd: Do not allow thread drop
When the ospf->oi_write_q is not empty that means that ospf could already have a thread scheduled for running. Just dropping the pointer before resheduling does not stop the one currently scheduled for running from running. The calling of thread_add_write checks to see if we are already running and does the right thing here so it is sufficient to just call thread_add_write. This issue was tracked down from this stack trace: Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [EC 134217739] interface eth2.1032:172.16.4.110: ospf_check_md5 bad sequence 5333618 (expect 5333649) Oct 19 18:04:00 VYOS-R1 ospfd[1811]: message repeated 3 times: [ [EC 134217739] interface eth2.1032:172.16.4.110: ospf_check_md5 bad sequence 5333618 (expect 5333649)] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: Assertion `node’ failed in file ospfd/ospf_packet.c, line 666, function ospf_write Oct 19 18:04:00 VYOS-R1 ospfd[1811]: Backtrace for 8 stack frames: Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 0] /usr/lib/libfrr.so.0(zlog_backtrace+0x3a) [0x7fef3efe9f8a] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 1] /usr/lib/libfrr.so.0(_zlog_assert_failed+0x61) [0x7fef3efea501] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 2] /usr/lib/frr/ospfd(+0x2f15e) [0x562e0c91815e] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 3] /usr/lib/libfrr.so.0(thread_call+0x60) [0x7fef3f00d430] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 4] /usr/lib/libfrr.so.0(frr_run+0xd8) [0x7fef3efe7938] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 5] /usr/lib/frr/ospfd(main+0x153) [0x562e0c901753] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fef3d83db45] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: [bt 7] /usr/lib/frr/ospfd(+0x190be) [0x562e0c9020be] Oct 19 18:04:00 VYOS-R1 ospfd[1811]: Current thread function ospf_write, scheduled from file ospfd/ospf_packet.c, line 881 Oct 19 18:04:00 VYOS-R1 zebra[1771]: [EC 4043309116] Client ‘ospf’ encountered an error and is shutting down. Oct 19 18:04:00 VYOS-R1 zebra[1771]: client 41 disconnected. 0 ospf routes removed from the rib We had an assert(node) in ospf_write, which means that the list was empty. So I just searched until I saw a code path that allowed multiple writes to the ospf_write function. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_packet.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 359d59cb5..79b464880 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -875,11 +875,9 @@ static int ospf_write(struct thread *thread)
}
/* If packets still remain in queue, call write thread. */
- if (!list_isempty(ospf->oi_write_q)) {
- ospf->t_write = NULL;
+ if (!list_isempty(ospf->oi_write_q))
thread_add_write(master, ospf_write, ospf, ospf->fd,
&ospf->t_write);
- }
return 0;
}