From c3bd5a10f10197a23063b142b260a76b29f69b1b Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 14 May 2017 14:20:17 -0400 Subject: [PATCH] pimd: Store the pim instance off of the pim interface Storing the pim instance off of the pim interface will allow us to easily keep track of vrf information. This is because pretty much is everything is interface based. Signed-off-by: Donald Sharp --- pimd/pim_iface.c | 3 +++ pimd/pim_iface.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index f3f8605ab7..5e47bb19b0 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -103,6 +103,7 @@ static void *if_list_clean(struct pim_interface *pim_ifp) struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim) { struct pim_interface *pim_ifp; + struct vrf *vrf; zassert(ifp); zassert(!ifp->info); @@ -114,6 +115,8 @@ struct pim_interface *pim_if_new(struct interface *ifp, int igmp, int pim) } pim_ifp->options = 0; + vrf = vrf_info_lookup(ifp->vrf_id); + pim_ifp->pim = vrf->info; pim_ifp->mroute_vif_index = -1; pim_ifp->igmp_version = IGMP_DEFAULT_VERSION; diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h index e742e68f67..9aab43ed93 100644 --- a/pimd/pim_iface.h +++ b/pimd/pim_iface.h @@ -73,6 +73,8 @@ struct pim_secondary_addr { struct pim_interface { uint32_t options; /* bit vector */ ifindex_t mroute_vif_index; + struct pim_instance *pim; + struct in_addr primary_address; /* remember addr to detect change */ struct list *sec_addr_list; /* list of struct pim_secondary_addr */ struct in_addr update_source; /* user can statically set the primary -- 2.39.5