forked from Mirror/frr
bfdd: Fix demultiplexing to rely solely on Your Discriminator as per RFC 5880.
According to RFC 5880 Section 6.3, once the remote peer reflects back the local discriminator, the receiver MUST demultiplex subsequent BFD packets based solely on the Your Discriminator field. The source IP or interface MUST NOT be used in demultiplexing once the session is established. Signed-off-by: zmw12306 <zmw12306@gmail.com>
This commit is contained in:
parent
44c4743e08
commit
b2ab620121
21
bfdd/bfd.c
21
bfdd/bfd.c
|
@ -755,26 +755,7 @@ void ptm_sbfd_echo_sess_dn(struct bfd_session *bfd, uint8_t diag)
|
||||||
static struct bfd_session *bfd_find_disc(struct sockaddr_any *sa,
|
static struct bfd_session *bfd_find_disc(struct sockaddr_any *sa,
|
||||||
uint32_t ldisc)
|
uint32_t ldisc)
|
||||||
{
|
{
|
||||||
struct bfd_session *bs;
|
return bfd_id_lookup(ldisc);
|
||||||
|
|
||||||
bs = bfd_id_lookup(ldisc);
|
|
||||||
if (bs == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
switch (bs->key.family) {
|
|
||||||
case AF_INET:
|
|
||||||
if (memcmp(&sa->sa_sin.sin_addr, &bs->key.peer,
|
|
||||||
sizeof(sa->sa_sin.sin_addr)))
|
|
||||||
return NULL;
|
|
||||||
break;
|
|
||||||
case AF_INET6:
|
|
||||||
if (memcmp(&sa->sa_sin6.sin6_addr, &bs->key.peer,
|
|
||||||
sizeof(sa->sa_sin6.sin6_addr)))
|
|
||||||
return NULL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *cp,
|
struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *cp,
|
||||||
|
|
Loading…
Reference in a new issue