bfdd: add vrf information as key element for bfd session search

the default vrf is looked up, in the search list algorithm.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2019-06-19 16:49:59 +02:00
parent b5c056fa08
commit 3a20889ff6
2 changed files with 5 additions and 4 deletions

View File

@ -391,10 +391,8 @@ struct bfd_session *ptm_bfd_sess_find(struct bfd_pkt *cp,
/* Search for session without using discriminator. */
ifp = if_lookup_by_index(ifindex, vrfid);
if (vrfid != VRF_DEFAULT)
vrf = vrf_lookup_by_id(vrfid);
else
vrf = NULL;
vrf = vrf_lookup_by_id(vrfid);
gen_bfd_key(&key, peer, local, is_mhop, ifp ? ifp->name : NULL,
vrf ? vrf->name : VRF_DEFAULT_NAME);

View File

@ -376,6 +376,9 @@ static int _ptm_msg_read(struct stream *msg, int command, vrf_id_t vrf_id,
log_error("ptm-read: vrf id %u could not be identified", vrf_id);
return -1;
}
} else {
bpc->bpc_has_vrfname = true;
strlcpy(bpc->bpc_vrfname, VRF_DEFAULT_NAME, sizeof(bpc->bpc_vrfname));
}
STREAM_GETC(msg, bpc->bpc_cbit);