summaryrefslogtreecommitdiff
path: root/lib/libfrr.h
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2021-02-03 01:02:15 +0300
committerIgor Ryzhov <iryzhov@nfware.com>2021-02-04 01:22:29 +0300
commit6cfcb775ef5d6004857b3d68e2bf757cf2a7a871 (patch)
tree82ca006f97002907ab56b4a26f3cb4a6fa16e9a5 /lib/libfrr.h
parentcc73a06499cc31b29e96e6b04ab6e7b181f09e28 (diff)
bfdd: fix session lookup
BFD key has optional fields "local" and "ifname" which can be empty when the BFD session is created. In this case, the hash key will be calculated with these fields filled with zeroes. Later, when we're looking for the BFD session using the key with fields "local" and "ifname" populated with actual values, the hash key will be different. To work around this issue, we're doing multiple hash lookups, first with full key, then with fields "local" and "ifname" filled with zeroes. But there may be another case when the initial key has the actual values for "local" and "ifname", but the key we're using for lookup has empty values. This case is covered for IPv4 by using additional hash walk with bfd_key_lookup_ignore_partial_walker function but is not covered for IPv6. Instead of introducing more hacks and workarounds, the following solution is proposed: - the hash key is always calculated in bfd_key_hash_do using only required fields - the hash data is compared in bfd_key_hash_cmp, taking into account the fact that fields "local" and "ifname" may be empty Using this solution, it's enough to make only one hash lookup. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/libfrr.h')
0 files changed, 0 insertions, 0 deletions