From: Quentin Young Date: Mon, 12 Jun 2017 21:16:40 +0000 (+0000) Subject: bgpd: be more promiscuous with updgrp packets X-Git-Tag: frr-4.0-dev~120^2~25 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=bbac44ace545066d0d43370e63baa77ceade9242;p=mirror%2Ffrr.git bgpd: be more promiscuous with updgrp packets 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 --- diff --git a/bgpd/bgp_io.c b/bgpd/bgp_io.c index 0e557ec205..78a421bd83 100644 --- a/bgpd/bgp_io.c +++ b/bgpd/bgp_io.c @@ -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);