summaryrefslogtreecommitdiffstats
path: root/bfdd
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2021-10-27 21:29:39 +0200
committerGitHub <noreply@github.com>2021-10-27 21:29:39 +0200
commitf727c6ae8a62be99bd5be5a191fbd7df455a35f0 (patch)
tree9e9bde7f79993485caf03678351041c05379a81e /bfdd
parentMerge pull request #9902 from LabNConsulting/working/lb/lutil-wait-optimization (diff)
parentlib: make if_lookup_by_name_all_vrf internal (diff)
downloadfrr-f727c6ae8a62be99bd5be5a191fbd7df455a35f0.tar.xz
frr-f727c6ae8a62be99bd5be5a191fbd7df455a35f0.zip
Merge pull request #9837 from idryzhov/cleanup-if-by-name-vrf-all
*: fix usage of if_lookup_by_name_all_vrf
Diffstat (limited to 'bfdd')
-rw-r--r--bfdd/bfd.c31
1 files changed, 7 insertions, 24 deletions
diff --git a/bfdd/bfd.c b/bfdd/bfd.c
index c66fccb85..a4091534f 100644
--- a/bfdd/bfd.c
+++ b/bfdd/bfd.c
@@ -315,45 +315,28 @@ int bfd_session_enable(struct bfd_session *bs)
vrf = vrf_lookup_by_name(bs->key.vrfname);
if (vrf == NULL) {
zlog_err(
- "session-enable: specified VRF doesn't exists.");
+ "session-enable: specified VRF %s doesn't exists.",
+ bs->key.vrfname);
return 0;
}
+ } else {
+ vrf = vrf_lookup_by_id(VRF_DEFAULT);
}
- if (!vrf_is_backend_netns() && vrf && vrf->vrf_id != VRF_DEFAULT
- && !if_lookup_by_name(vrf->name, vrf->vrf_id)) {
- zlog_err("session-enable: vrf interface %s not available yet",
- vrf->name);
- return 0;
- }
+ assert(vrf);
if (bs->key.ifname[0]) {
- if (vrf)
- ifp = if_lookup_by_name(bs->key.ifname, vrf->vrf_id);
- else
- ifp = if_lookup_by_name_all_vrf(bs->key.ifname);
+ ifp = if_lookup_by_name(bs->key.ifname, vrf->vrf_id);
if (ifp == NULL) {
zlog_err(
"session-enable: specified interface %s (VRF %s) doesn't exist.",
- bs->key.ifname, vrf ? vrf->name : "<all>");
+ bs->key.ifname, vrf->name);
return 0;
}
- if (bs->key.ifname[0] && !vrf) {
- vrf = vrf_lookup_by_id(ifp->vrf_id);
- if (vrf == NULL) {
- zlog_err(
- "session-enable: specified VRF %u doesn't exist.",
- ifp->vrf_id);
- return 0;
- }
- }
}
/* Assign interface/VRF pointers. */
bs->vrf = vrf;
- if (bs->vrf == NULL)
- bs->vrf = vrf_lookup_by_id(VRF_DEFAULT);
- assert(bs->vrf);
/* Assign interface pointer (if any). */
bs->ifp = ifp;