]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: be more promiscuous with updgrp packets
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 12 Jun 2017 21:16:40 +0000 (21:16 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 30 Nov 2017 21:18:03 +0000 (16:18 -0500)
Slightly incorrect trigger for generating update group packets. In order
to match semantics of previous bgp_write() we need to trigger
update-group packet generation after every write operation, even if no
packets were written. Of course if we're tearing down the session we can
still skip this operation.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
bgpd/bgp_io.c

index 0e557ec2050f2d90549e4088cffbff2f1a315602..78a421bd837cab6e32fcd46a6858e6050947f060 100644 (file)
@@ -191,6 +191,7 @@ static int bgp_process_writes(struct thread *thread)
        peer = THREAD_ARG(thread);
        uint16_t status;
        bool reschedule;
+       bool fatal = false;
 
        if (peer->fd < 0)
                return -1;
@@ -207,12 +208,17 @@ static int bgp_process_writes(struct thread *thread)
        if (CHECK_FLAG(status, BGP_IO_TRANS_ERR)) { /* no problem */
        }
 
-       if (CHECK_FLAG(status, BGP_IO_FATAL_ERR))
+       if (CHECK_FLAG(status, BGP_IO_FATAL_ERR)) {
                reschedule = false; /* problem */
+               fatal = true;
+       }
 
        if (reschedule) {
                thread_add_write(fpt->master, bgp_process_writes, peer,
                                 peer->fd, &peer->t_write);
+       }
+
+       if (!fatal) {
                thread_add_timer_msec(bm->master, bgp_generate_updgrp_packets,
                                      peer, 0,
                                      &peer->t_generate_updgrp_packets);