]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: fix some memory errors, scheduling bugs
authorQuentin Young <qlyoung@cumulusnetworks.com>
Sat, 21 Apr 2018 07:55:44 +0000 (03:55 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 29 May 2018 19:06:16 +0000 (19:06 +0000)
* Add doc comments explaining hairy bits of thread lifecycle
* Remove t_suicide as it no longer makes sense
* Remove client double-free
* Remove unnecessary THREAD_OFF being used in incorrect pthread context
* Eliminate unnecessary racey access to client's obuf_fifo
* Ensure zserv_process_messages() reschedules itself if it has not
  finished its work

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
zebra/zserv.c
zebra/zserv.h

index 625174e241100f6bcdec92d2267f5eb056ee1e1e..fa5299850c079a8d17f30bdbd6d02229f4ca223d 100644 (file)
@@ -109,6 +109,14 @@ static void zebra_client_free(struct zserv *client)
        assert(!client->t_read);
        assert(!client->t_write);
 
+       /*
+        * Ensure these have been nulled. This does not equate to the
+        * associated task(s) being scheduled or unscheduled on the client
+        * pthread's threadmaster.
+        */
+       assert(!client->t_read);
+       assert(!client->t_write);
+
        /* Close file descriptor. */
        if (client->sock) {
                unsigned long nroutes;
index f466545fc8fd431845f3375ab20e6f1f9473d4ae..c64ed3c6772cd508572dde7f3488b81fd3554253 100644 (file)
@@ -73,9 +73,6 @@ struct zserv {
        struct thread *t_read;
        struct thread *t_write;
 
-       /* Thread for delayed close. */
-       struct thread *t_suicide;
-
        /* default routing table this client munges */
        int rtm_table;