mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 11:18:43 +00:00
Merge pull request #3977 from opensourcerouting/bfd-small-fixes
bfdd: two small fixes
This commit is contained in:
commit
c3eb25c3fe
@ -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))) {
|
if (memcmp(&bs->key.local, &zero_addr, sizeof(bs->key.local))) {
|
||||||
bpc->bpc_local.sa_sin.sin_family = AF_INET6;
|
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));
|
sizeof(bpc->bpc_local.sa_sin.sin_addr));
|
||||||
}
|
}
|
||||||
break;
|
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));
|
sizeof(bpc->bpc_peer.sa_sin6.sin6_addr));
|
||||||
|
|
||||||
bpc->bpc_local.sa_sin6.sin6_family = AF_INET6;
|
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));
|
sizeof(bpc->bpc_local.sa_sin6.sin6_addr));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -141,6 +141,7 @@ void ptm_bfd_echo_snd(struct bfd_session *bfd)
|
|||||||
if (BFD_CHECK_FLAG(bfd->flags, BFD_SESS_FLAG_IPV6)) {
|
if (BFD_CHECK_FLAG(bfd->flags, BFD_SESS_FLAG_IPV6)) {
|
||||||
sd = bglobal.bg_echov6;
|
sd = bglobal.bg_echov6;
|
||||||
memset(&sin6, 0, sizeof(sin6));
|
memset(&sin6, 0, sizeof(sin6));
|
||||||
|
sin6.sin6_family = AF_INET6;
|
||||||
memcpy(&sin6.sin6_addr, &bfd->key.peer, sizeof(sin6.sin6_addr));
|
memcpy(&sin6.sin6_addr, &bfd->key.peer, sizeof(sin6.sin6_addr));
|
||||||
if (bfd->ifp && IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr))
|
if (bfd->ifp && IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr))
|
||||||
sin6.sin6_scope_id = bfd->ifp->ifindex;
|
sin6.sin6_scope_id = bfd->ifp->ifindex;
|
||||||
@ -155,6 +156,7 @@ void ptm_bfd_echo_snd(struct bfd_session *bfd)
|
|||||||
} else {
|
} else {
|
||||||
sd = bglobal.bg_echo;
|
sd = bglobal.bg_echo;
|
||||||
memset(&sin6, 0, sizeof(sin6));
|
memset(&sin6, 0, sizeof(sin6));
|
||||||
|
sin.sin_family = AF_INET;
|
||||||
memcpy(&sin.sin_addr, &bfd->key.peer, sizeof(sin.sin_addr));
|
memcpy(&sin.sin_addr, &bfd->key.peer, sizeof(sin.sin_addr));
|
||||||
sin.sin_port = htons(BFD_DEF_ECHO_PORT);
|
sin.sin_port = htons(BFD_DEF_ECHO_PORT);
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
||||||
|
Loading…
Reference in New Issue
Block a user