From 95fd223cc3a7a6f7cdefebf39934c74e15091b6a Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Tue, 18 Jan 2022 05:00:45 -0500 Subject: bfdd: fix the possibly wrong counter of control packets Since control packets may be dropped by ttl check, the counter operation should be put after all check including ttl check. Signed-off-by: anlan_cs --- bfdd/bfd_packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bfdd') diff --git a/bfdd/bfd_packet.c b/bfdd/bfd_packet.c index 652b91411..839f06329 100644 --- a/bfdd/bfd_packet.c +++ b/bfdd/bfd_packet.c @@ -639,8 +639,6 @@ int bfd_recv_cb(struct thread *t) return 0; } - bfd->stats.rx_ctrl_pkt++; - /* * Multi hop: validate packet TTL. * Single hop: set local address that received the packet. @@ -656,6 +654,8 @@ int bfd_recv_cb(struct thread *t) bfd->local_address = local; } + bfd->stats.rx_ctrl_pkt++; + /* * If no interface was detected, save the interface where the * packet came in. -- cgit v1.2.3