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 <vic.lan@pica8.com>
This commit is contained in:
anlan_cs 2022-01-18 05:00:45 -05:00
parent 3ae667e527
commit 95fd223cc3

View 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.