summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-06-19 16:49:59 +0200
committerPhilippe Guibert <philippe.guibert@6wind.com>2019-08-27 15:08:50 +0200
commit3a20889ff61c0cfaee73128324957b10603d361f (patch)
treef2306644a63a24ce149fc46e1066431719b119b6
parentb5c056fa0888d0dad5a7c5c0b00ee0d1c20440bc (diff)
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>
-rw-r--r--bfdd/bfd.c6
-rw-r--r--bfdd/ptm_adapter.c3
2 files changed, 5 insertions, 4 deletions
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);