diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-10-06 15:20:02 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-10-06 15:20:02 +0200 |
commit | 1ba2a97af940168a4ca7673287272000f27f93ca (patch) | |
tree | 020f9328489db5f2bf768c49b4a024e184ea5742 /bgpd/bgp_packet.c | |
parent | bgpd: Fix crash in vnc_import_bgp_add_route (diff) | |
download | frr-1ba2a97af940168a4ca7673287272000f27f93ca.tar.xz frr-1ba2a97af940168a4ca7673287272000f27f93ca.zip |
bgpd: 'Last write' does not update when we TX a keepalive
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
Ticket: CM-5518
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r-- | bgpd/bgp_packet.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index ae54cd43d..681151344 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -341,6 +341,7 @@ bgp_write (struct thread *thread) u_char type; struct stream *s; int num; + int update_last_write = 0; unsigned int count = 0; unsigned int oc = 0; @@ -432,6 +433,7 @@ bgp_write (struct thread *thread) /* OK we send packet so delete it. */ bgp_packet_delete (peer); + update_last_write = 1; } while (++count < peer->bgp->wpkt_quanta && (s = bgp_write_packet (peer)) != NULL); @@ -439,8 +441,12 @@ bgp_write (struct thread *thread) bgp_write_proceed_actions (peer); done: - /* Update the last write if some updates were written. */ + /* Update last_update if UPDATEs were written. */ if (peer->update_out > oc) + peer->last_update = bgp_clock (); + + /* If we TXed any flavor of packet update last_write */ + if (update_last_write) peer->last_write = bgp_clock (); sockopt_cork (peer->fd, 0); |