mirror_frr/ospfd
Donald Sharp 4bb420ab81 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>
2018-10-20 09:04:25 -04:00
..
.gitignore *: cleanup .gitignore files 2018-09-08 21:30:42 +02:00
ChangeLog.opaque.txt Initial revision 2003-02-03 16:31:16 +00:00
Makefile build: non-recursive ospf* 2017-08-04 11:09:50 +02:00
ospf_abr.c ospfd: handling of OSPF_AREA_RANGE_ADVERTISE flag 2018-09-24 21:46:16 -07:00
ospf_abr.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_api.c ospfd: OoB access (Coverity 1221445 1221448) 2018-06-25 11:22:20 +02:00
ospf_api.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_apiserver.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_apiserver.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_asbr.c *: style for flog_warn conversions 2018-09-06 20:56:41 +00:00
ospf_asbr.h ospfd: Remove unused function 2018-08-21 08:40:51 -04:00
ospf_ase.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_ase.h *: reindent 2017-07-17 14:04:07 +02:00
ospf_bfd.c bgpd/ospfd: make bgp and ospf json response a bit more consistent 2018-08-30 12:40:18 +00:00
ospf_bfd.h bgpd/ospfd: make bgp and ospf json response a bit more consistent 2018-08-30 12:40:18 +00:00
ospf_dump_api.c *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_dump_api.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_dump.c ospfd: fix symbol collision 2018-10-01 18:18:42 +02:00
ospf_dump.h ospfd: fix symbol collision 2018-10-01 18:18:42 +02:00
ospf_errors.c ospfd: OSPF_[ERR|WARN] -> EC_OSPF 2018-09-13 18:56:04 +00:00
ospf_errors.h ospfd: OSPF_[ERR|WARN] -> EC_OSPF 2018-09-13 18:56:04 +00:00
ospf_ext.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_ext.h *: conform with COMMUNITY.md formatting rules, via 'make indent' 2018-03-06 14:04:32 -05:00
ospf_flood.c ospfd: default route got flushed after lsa refresh timer. 2018-10-07 23:22:58 -07:00
ospf_flood.h ospfd: OSPFv2 VRF Support 2017-10-03 09:15:19 -07:00
ospf_ia.c bgpd isisd ospf6d ospfd: variable shadowing fixes 2018-09-12 16:44:36 +02:00
ospf_ia.h *: reindent 2017-07-17 14:04:07 +02:00
ospf_interface.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_interface.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_ism.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_ism.h *: reindent 2017-07-17 14:04:07 +02:00
ospf_lsa.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_lsa.h ospfd: Add ospf_lsa_new_and_data function and abstract away 2018-08-20 20:41:37 -04:00
ospf_lsdb.c ospfd: Cleanup some warnings that were not warnings 2018-09-06 20:50:58 +00:00
ospf_lsdb.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_main.c ospfd: fix symbol collision 2018-10-01 18:18:42 +02:00
ospf_memory.c OSPFD: Add Experimental Segment Routing support 2018-01-18 19:11:11 +01:00
ospf_memory.h OSPFD: Add Experimental Segment Routing support 2018-01-18 19:11:11 +01:00
ospf_neighbor.c *: style for flog_warn conversions 2018-09-06 20:56:41 +00:00
ospf_neighbor.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_network.c *: style for EC replacements 2018-09-13 19:38:57 +00:00
ospf_network.h ospfd: basic support for VRF NETNS backend 2018-02-27 11:11:24 +01:00
ospf_nsm.c ospfd: OSPF_[ERR|WARN] -> EC_OSPF 2018-09-13 18:56:04 +00:00
ospf_nsm.h *: reindent 2017-07-17 14:04:07 +02:00
ospf_opaque.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_opaque.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_packet.c ospfd: Do not allow thread drop 2018-10-20 09:04:25 -04:00
ospf_packet.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_ri.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_ri.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_route.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_route.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_routemap.c ospfd: OSPF_[ERR|WARN] -> EC_OSPF 2018-09-13 18:56:04 +00:00
ospf_snmp.c *: fix clang-6 SA warnings 2018-09-08 20:34:35 +02:00
ospf_spf.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_spf.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_sr.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_sr.h OSPFD: Fix Segment Routing Lan Adjacency TLVs 2018-02-19 10:17:41 +01:00
ospf_te.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospf_te.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
ospf_vty.c Merge pull request #3077 from rgirada/ospf_2980_fix 2018-10-09 19:07:33 +02:00
ospf_vty.h ospfd: buffer termination (Coverity 23089) 2018-06-14 17:43:19 +02:00
ospf_zebra.c Merge pull request #3077 from rgirada/ospf_2980_fix 2018-10-09 19:07:33 +02:00
ospf_zebra.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
OSPF-ALIGNMENT.txt *: Remove cvs control points 2017-12-05 17:28:12 -05:00
OSPF-MIB.txt spelling: s/supress/suppress/ 2004-11-05 13:24:12 +00:00
OSPF-TRAP-MIB.txt Initial revision 2002-12-13 20:15:29 +00:00
ospfd.c *: list_delete_and_null() -> list_delete() 2018-10-02 11:40:52 +02:00
ospfd.conf.sample Initial revision 2002-12-13 20:15:29 +00:00
ospfd.h *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
subdir.am build: fix not building docs w/o sphinx 2018-09-09 20:01:08 +02:00