From: Philippe Guibert Date: Wed, 19 Jun 2019 14:49:59 +0000 (+0200) Subject: bfdd: add vrf information as key element for bfd session search X-Git-Tag: base_7.3~353^2~8 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=3a20889ff61c0cfaee73128324957b10603d361f;p=matthieu%2Ffrr.git 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 --- diff --git a/bfdd/bfd.c b/bfdd/bfd.c index 5d143d4e5f..2a41758bbc 100644 --- a/bfdd/bfd.c +++ b/bfdd/bfd.c @@ -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); diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index 3e2ace6ea6..553033abfb 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -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);