summaryrefslogtreecommitdiffstats
path: root/bfdd/bfd_packet.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2019-01-31 21:10:32 +0100
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-02-14 17:17:29 +0100
commitf43b93686fafd80ad86630327cb9dcfefbf0ee9a (patch)
tree2d3610e2a3c112f2f6d878b3350267992d43d80a /bfdd/bfd_packet.c
parentbfdd: don't poll to make echo/multiplier changes (diff)
downloadfrr-f43b93686fafd80ad86630327cb9dcfefbf0ee9a.tar.xz
frr-f43b93686fafd80ad86630327cb9dcfefbf0ee9a.zip
bfdd: simplify timer data structure
Remove some legacy left overs of the old timer data structure bits and use a simpler version: We always keep the current configuration in the timer structure, but also keep the running timers (before poll transition) in `cur_timers`. With this we can remove `new_timers` and avoid timer copy configuration copy on final handler (this also simplifies peer show command). Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd/bfd_packet.c')
-rw-r--r--bfdd/bfd_packet.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c
index 1c55db39f..7a7a5a5d9 100644
--- a/bfdd/bfd_packet.c
+++ b/bfdd/bfd_packet.c
@@ -229,12 +229,20 @@ void ptm_bfd_snd(struct bfd_session *bfd, int fbit)
cp.discrs.remote_discr = htonl(bfd->discrs.remote_discr);
if (bfd->polling) {
cp.timers.desired_min_tx =
- htonl(bfd->new_timers.desired_min_tx);
+ htonl(bfd->timers.desired_min_tx);
cp.timers.required_min_rx =
- htonl(bfd->new_timers.required_min_rx);
+ htonl(bfd->timers.required_min_rx);
} else {
- cp.timers.desired_min_tx = htonl(bfd->timers.desired_min_tx);
- cp.timers.required_min_rx = htonl(bfd->timers.required_min_rx);
+ /*
+ * We can only announce current setting on poll, this
+ * avoids timing mismatch with our peer and give it
+ * the oportunity to learn. See `bs_final_handler` for
+ * more information.
+ */
+ cp.timers.desired_min_tx =
+ htonl(bfd->cur_timers.desired_min_tx);
+ cp.timers.required_min_rx =
+ htonl(bfd->cur_timers.required_min_rx);
}
cp.timers.required_min_echo = htonl(bfd->timers.required_min_echo);