Merge pull request #3977 from opensourcerouting/bfd-small-fixes

bfdd: two small fixes
This commit is contained in:
Quentin Young 2019-03-20 01:01:08 -04:00 committed by GitHub
commit c3eb25c3fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -1231,7 +1231,7 @@ void bs_to_bpc(struct bfd_session *bs, struct bfd_peer_cfg *bpc)
if (memcmp(&bs->key.local, &zero_addr, sizeof(bs->key.local))) {
bpc->bpc_local.sa_sin.sin_family = AF_INET6;
memcpy(&bpc->bpc_local.sa_sin.sin_addr, &bs->key.peer,
memcpy(&bpc->bpc_local.sa_sin.sin_addr, &bs->key.local,
sizeof(bpc->bpc_local.sa_sin.sin_addr));
}
break;
@ -1242,7 +1242,7 @@ void bs_to_bpc(struct bfd_session *bs, struct bfd_peer_cfg *bpc)
sizeof(bpc->bpc_peer.sa_sin6.sin6_addr));
bpc->bpc_local.sa_sin6.sin6_family = AF_INET6;
memcpy(&bpc->bpc_local.sa_sin6.sin6_addr, &bs->key.peer,
memcpy(&bpc->bpc_local.sa_sin6.sin6_addr, &bs->key.local,
sizeof(bpc->bpc_local.sa_sin6.sin6_addr));
break;
}

View File

@ -141,6 +141,7 @@ void ptm_bfd_echo_snd(struct bfd_session *bfd)
if (BFD_CHECK_FLAG(bfd->flags, BFD_SESS_FLAG_IPV6)) {
sd = bglobal.bg_echov6;
memset(&sin6, 0, sizeof(sin6));
sin6.sin6_family = AF_INET6;
memcpy(&sin6.sin6_addr, &bfd->key.peer, sizeof(sin6.sin6_addr));
if (bfd->ifp && IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr))
sin6.sin6_scope_id = bfd->ifp->ifindex;
@ -155,6 +156,7 @@ void ptm_bfd_echo_snd(struct bfd_session *bfd)
} else {
sd = bglobal.bg_echo;
memset(&sin6, 0, sizeof(sin6));
sin.sin_family = AF_INET;
memcpy(&sin.sin_addr, &bfd->key.peer, sizeof(sin.sin_addr));
sin.sin_port = htons(BFD_DEF_ECHO_PORT);
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN