summaryrefslogtreecommitdiffstats
path: root/bfdd
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2019-03-06 21:50:04 +0100
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-03-06 21:50:04 +0100
commit2435b7defe734ab42f8b30368ff842aa0a5b6c42 (patch)
treed0e81aec9e011f9c27524ae6e62d36117413e4af /bfdd
parentMerge pull request #3855 from donaldsharp/bgp_clist_sa (diff)
downloadfrr-2435b7defe734ab42f8b30368ff842aa0a5b6c42.tar.xz
frr-2435b7defe734ab42f8b30368ff842aa0a5b6c42.zip
bfdd: fix single hop IPv6 configurations
Don't assume IPv6 will always be multi hop and handle the single hop link-local address case. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c
index be6f2caa4..36133f572 100644
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@ -208,13 +208,17 @@ int bfd_session_enable(struct bfd_session *bs)
/* Set the IPv6 scope id for link-local addresses. */
if (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_IPV6)) {
- sin6 = &bs->mhop.peer.sa_sin6;
+ sin6 = (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_MH))
+ ? &bs->mhop.peer.sa_sin6
+ : &bs->shop.peer.sa_sin6;
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
sin6->sin6_scope_id = bs->ifp != NULL
? bs->ifp->ifindex
: IFINDEX_INTERNAL;
- sin6 = &bs->mhop.local.sa_sin6;
+ sin6 = (BFD_CHECK_FLAG(bs->flags, BFD_SESS_FLAG_MH))
+ ? &bs->mhop.local.sa_sin6
+ : &bs->local_address.sa_sin6;
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
sin6->sin6_scope_id = bs->ifp != NULL
? bs->ifp->ifindex