]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bfdd: fix the possibly wrong counter of control packets
authoranlan_cs <vic.lan@pica8.com>
Tue, 18 Jan 2022 10:00:45 +0000 (05:00 -0500)
committeranlan_cs <vic.lan@pica8.com>
Tue, 18 Jan 2022 10:19:54 +0000 (05:19 -0500)
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 <vic.lan@pica8.com>
bfdd/bfd_packet.c

index 652b91411870973caaedac885e6659b9cfdd44cd..839f06329a39e87f89d3f86e6dbc8fa47a6b2526 100644 (file)
@@ -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.