diff options
author | Philippe Guibert <philippe.guibert@6wind.com> | 2019-08-29 16:27:00 +0200 |
---|---|---|
committer | Philippe Guibert <philippe.guibert@6wind.com> | 2021-11-23 09:02:23 +0100 |
commit | c742573b67f9b1be953da8f67f417182e7e5dbcb (patch) | |
tree | ef43653783f7113fbcbdfeeadf9d3bae09f39aec /bgpd/bgp_bmp.c | |
parent | Merge pull request #10089 from donaldsharp/really_remove (diff) | |
download | frr-c742573b67f9b1be953da8f67f417182e7e5dbcb.tar.xz frr-c742573b67f9b1be953da8f67f417182e7e5dbcb.zip |
lib: resolver per vrf support
add a parameter to resolver api that is the vrf identifier. this permits
to make resolution self to each vrf. in case vrf netns backend is used,
this is very practical, since resolution can happen on one netns, while
it is not the case in an other one.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'bgpd/bgp_bmp.c')
-rw-r--r-- | bgpd/bgp_bmp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bgpd/bgp_bmp.c b/bgpd/bgp_bmp.c index 1bc3fd0db..b4da22699 100644 --- a/bgpd/bgp_bmp.c +++ b/bgpd/bgp_bmp.c @@ -1833,6 +1833,7 @@ static int bmp_active_thread(struct thread *t) socklen_t slen; int status, ret; char buf[SU_ADDRSTRLEN]; + vrf_id_t vrf_id; /* all 3 end up here, though only timer or read+write are active * at a time */ @@ -1843,7 +1844,12 @@ static int bmp_active_thread(struct thread *t) ba->last_err = NULL; if (ba->socket == -1) { - resolver_resolve(&ba->resq, AF_UNSPEC, ba->hostname, + /* get vrf_id */ + if (!ba->targets || !ba->targets->bgp) + vrf_id = VRF_DEFAULT; + else + vrf_id = ba->targets->bgp->vrf_id; + resolver_resolve(&ba->resq, AF_UNSPEC, vrf_id, ba->hostname, bmp_active_resolved); return 0; } |