summaryrefslogtreecommitdiff
path: root/ripd/ripd.c
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2019-02-19 21:08:43 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2019-02-19 21:11:37 +0100
commitaec0d756677e52e86ef9b22fe2d85bbe8f0039e5 (patch)
tree960bb8e8e1aa69d564c3baa49f4b8beb1de746c3 /ripd/ripd.c
parent4b23867cad558a59e8d315400b82c0453510c9af (diff)
eigrp, rip, ripng, lib: unlink if_rmap from vrf
an interface rmap context can be created from a custom name string, instead of a vrf. This ability permits to handle several instances of interface route map in the same vrf. The naming convention will be transparent on what the name is for in the daemon code. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
Diffstat (limited to 'ripd/ripd.c')
-rw-r--r--ripd/ripd.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/ripd/ripd.c b/ripd/ripd.c
index b95034e400..03f335dd41 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -2717,8 +2717,7 @@ int rip_create(int socket)
rip_distribute_update);
/* if rmap install. */
- rip->if_rmap_ctx = if_rmap_ctx_create(
- vrf_lookup_by_id(VRF_DEFAULT));
+ rip->if_rmap_ctx = if_rmap_ctx_create(VRF_DEFAULT_NAME);
if_rmap_hook_add(rip->if_rmap_ctx, rip_if_rmap_update);
if_rmap_hook_delete(rip->if_rmap_ctx, rip_if_rmap_update);
@@ -3409,11 +3408,15 @@ void rip_clean(void)
static void rip_if_rmap_update(struct if_rmap_ctx *ctx,
struct if_rmap *if_rmap)
{
- struct interface *ifp;
+ struct interface *ifp = NULL;
struct rip_interface *ri;
struct route_map *rmap;
+ struct vrf *vrf = NULL;
- ifp = if_lookup_by_name(if_rmap->ifname, ctx->vrf->vrf_id);
+ if (ctx->name)
+ vrf = vrf_lookup_by_name(ctx->name);
+ if (vrf)
+ ifp = if_lookup_by_name(if_rmap->ifname, vrf->vrf_id);
if (ifp == NULL)
return;