diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-01-10 15:29:02 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2021-01-10 15:29:02 +0100 |
commit | 910adaa08bbd416288797505399ab47f990817e6 (patch) | |
tree | 1bb8dc591845949a87719e4a9e23ab24c012e6cf /proto/bfd/bfd.h | |
parent | 17663b6a7c505226cfe9ccc0671611075a3dff57 (diff) |
BFD: Dispatch sessions also by interface index
Direct BFD sessions needs to be dispatched not only by IP addresses, but
also by interfaces, in order to avoid collisions between neighbors with
the same IPv6 link-local addresses.
Extend BFD session hash_ip key by interface index to handle that. Use 0
for multihop sessions.
Thanks to Sebastian Hahn for the original patch.
Diffstat (limited to 'proto/bfd/bfd.h')
-rw-r--r-- | proto/bfd/bfd.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/proto/bfd/bfd.h b/proto/bfd/bfd.h index 83e2a991..91fdaa60 100644 --- a/proto/bfd/bfd.h +++ b/proto/bfd/bfd.h @@ -153,6 +153,7 @@ struct bfd_session u8 detect_mult; /* Announced detect_mult, local option */ u8 rem_detect_mult; /* Last received detect_mult */ + uint ifindex; /* Iface index, for hashing in bfd.session_hash_ip */ btime last_tx; /* Time of last sent periodic control packet */ btime last_rx; /* Time of last received valid control packet */ @@ -213,7 +214,7 @@ static inline void bfd_unlock_sessions(struct bfd_proto *p) { pthread_spin_unloc /* bfd.c */ struct bfd_session * bfd_find_session_by_id(struct bfd_proto *p, u32 id); -struct bfd_session * bfd_find_session_by_addr(struct bfd_proto *p, ip_addr addr); +struct bfd_session * bfd_find_session_by_addr(struct bfd_proto *p, ip_addr addr, uint ifindex); void bfd_session_process_ctl(struct bfd_session *s, u8 flags, u32 old_tx_int, u32 old_rx_int); void bfd_show_sessions(struct proto *P); |