diff options
Diffstat (limited to 'bfdd/bfd_packet.c')
| -rw-r--r-- | bfdd/bfd_packet.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index b7c1af7e71..652b914118 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -583,7 +583,7 @@ int bfd_recv_cb(struct thread *t) if (ifindex) { ifp = if_lookup_by_index(ifindex, vrfid); if (ifp) - vrfid = ifp->vrf_id; + vrfid = ifp->vrf->vrf_id; } /* Implement RFC 5880 6.8.6 */ @@ -697,11 +697,26 @@ int bfd_recv_cb(struct thread *t) /* Handle poll finalization. */ bs_final_handler(bfd); - } else { - /* Received a packet, lets update the receive timer. */ - bfd_recvtimer_update(bfd); } + /* + * Detection timeout calculation: + * The minimum detection timeout is the remote detection + * multipler (number of packets to be missed) times the agreed + * transmission interval. + * + * RFC 5880, Section 6.8.4. + */ + if (bfd->cur_timers.required_min_rx > bfd->remote_timers.desired_min_tx) + bfd->detect_TO = bfd->remote_detect_mult + * bfd->cur_timers.required_min_rx; + else + bfd->detect_TO = bfd->remote_detect_mult + * bfd->remote_timers.desired_min_tx; + + /* Apply new receive timer immediately. */ + bfd_recvtimer_update(bfd); + /* Handle echo timers changes. */ bs_echo_timer_handler(bfd); |
