summaryrefslogtreecommitdiffstats
path: root/bfdd
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2018-09-13 15:09:03 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2018-10-01 19:15:25 +0200
commit451eb5a2f81b4bcc0c18ed9a38ab2b55d5f0a277 (patch)
tree97cc5cca9d0bad3e272c93b5190d4760610643b9 /bfdd
parentMerge pull request #3105 from opensourcerouting/fix/sphinx-stamp (diff)
downloadfrr-451eb5a2f81b4bcc0c18ed9a38ab2b55d5f0a277.tar.xz
frr-451eb5a2f81b4bcc0c18ed9a38ab2b55d5f0a277.zip
bfdd: disable echo on neighbor request
Don't send echo packets when the neighbor configures echo-interval of 0 (e.g. disabled). Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfd.c6
-rw-r--r--bfdd/bfd_packet.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c
index cf7c027db..8d9de857f 100644
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@ -157,7 +157,8 @@ void ptm_bfd_echo_stop(struct bfd_session *bfd, int polling)
void ptm_bfd_echo_start(struct bfd_session *bfd)
{
bfd->echo_detect_TO = (bfd->remote_detect_mult * bfd->echo_xmt_TO);
- ptm_bfd_echo_xmt_TO(bfd);
+ if (bfd->echo_detect_TO > 0)
+ ptm_bfd_echo_xmt_TO(bfd);
bfd->polling = 1;
bfd->new_timers.desired_min_tx = bfd->up_min_tx;
@@ -324,7 +325,8 @@ int bfd_echo_xmt_cb(struct thread *t)
{
struct bfd_session *bs = THREAD_ARG(t);
- ptm_bfd_echo_xmt_TO(bs);
+ if (bs->echo_xmt_TO > 0)
+ ptm_bfd_echo_xmt_TO(bs);
return 0;
}
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c
index 8acb9438c..1ba5ee826 100644
--- a/bfdd/bfd_packet.c
+++ b/bfdd/bfd_packet.c
@@ -197,7 +197,8 @@ static int ptm_bfd_process_echo_pkt(int s)
bfd->echo_detect_TO = bfd->remote_detect_mult * bfd->echo_xmt_TO;
/* Update echo receive timeout. */
- bfd_echo_recvtimer_update(bfd);
+ if (bfd->echo_detect_TO > 0)
+ bfd_echo_recvtimer_update(bfd);
return 0;
}