summaryrefslogtreecommitdiffstats
path: root/pimd
diff options
context:
space:
mode:
Diffstat (limited to 'pimd')
-rw-r--r--pimd/pim_bfd.c2
-rw-r--r--pimd/pim_iface.c58
-rw-r--r--pimd/pim_igmp.c2
-rw-r--r--pimd/pim_static.c2
4 files changed, 30 insertions, 34 deletions
diff --git a/pimd/pim_bfd.c b/pimd/pim_bfd.c
index c7fcbba71..696544c8d 100644
--- a/pimd/pim_bfd.c
+++ b/pimd/pim_bfd.c
@@ -97,7 +97,7 @@ void pim_bfd_info_nbr_create(struct pim_interface *pim_ifp,
pim_ifp->bfd_config.min_rx, pim_ifp->bfd_config.min_tx);
bfd_sess_set_ipv4_addrs(neigh->bfd_session, NULL, &neigh->source_addr);
bfd_sess_set_interface(neigh->bfd_session, neigh->interface->name);
- bfd_sess_set_vrf(neigh->bfd_session, neigh->interface->vrf_id);
+ bfd_sess_set_vrf(neigh->bfd_session, neigh->interface->vrf->vrf_id);
bfd_sess_set_profile(neigh->bfd_session, pim_ifp->bfd_config.profile);
bfd_sess_install(neigh->bfd_session);
}
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 5e311d101..60152f355 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -121,7 +121,7 @@ struct pim_interface *pim_if_new(struct interface *ifp, bool igmp, bool pim,
pim_ifp = XCALLOC(MTYPE_PIM_INTERFACE, sizeof(*pim_ifp));
pim_ifp->options = 0;
- pim_ifp->pim = pim_get_pim_instance(ifp->vrf_id);
+ pim_ifp->pim = ifp->vrf->info;
pim_ifp->mroute_vif_index = -1;
pim_ifp->igmp_version = IGMP_DEFAULT_VERSION;
@@ -785,12 +785,11 @@ void pim_if_addr_del_all(struct interface *ifp)
struct connected *ifc;
struct listnode *node;
struct listnode *nextnode;
- struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
struct pim_instance *pim;
- if (!vrf)
+ pim = ifp->vrf->info;
+ if (!pim)
return;
- pim = vrf->info;
/* PIM/IGMP enabled ? */
if (!ifp->info)
@@ -857,10 +856,6 @@ struct in_addr pim_find_primary_addr(struct interface *ifp)
int v4_addrs = 0;
int v6_addrs = 0;
struct pim_interface *pim_ifp = ifp->info;
- struct vrf *vrf = vrf_lookup_by_id(ifp->vrf_id);
-
- if (!vrf)
- return addr;
if (pim_ifp && PIM_INADDR_ISNOT_ANY(pim_ifp->update_source)) {
return pim_ifp->update_source;
@@ -899,10 +894,11 @@ struct in_addr pim_find_primary_addr(struct interface *ifp)
struct interface *lo_ifp;
// DBS - Come back and check here
- if (ifp->vrf_id == VRF_DEFAULT)
- lo_ifp = if_lookup_by_name("lo", vrf->vrf_id);
+ if (ifp->vrf->vrf_id == VRF_DEFAULT)
+ lo_ifp = if_lookup_by_name("lo", ifp->vrf->vrf_id);
else
- lo_ifp = if_lookup_by_name(vrf->name, vrf->vrf_id);
+ lo_ifp = if_lookup_by_name(ifp->vrf->name,
+ ifp->vrf->vrf_id);
if (lo_ifp && (lo_ifp != ifp))
return pim_find_primary_addr(lo_ifp);
@@ -1550,13 +1546,13 @@ int pim_ifp_create(struct interface *ifp)
{
struct pim_instance *pim;
- pim = pim_get_pim_instance(ifp->vrf_id);
+ pim = ifp->vrf->info;
if (PIM_DEBUG_ZEBRA) {
zlog_debug(
- "%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
- __func__, ifp->name, ifp->ifindex, ifp->vrf_id,
- (long)ifp->flags, ifp->metric, ifp->mtu,
- if_is_operative(ifp));
+ "%s: %s index %d vrf %s(%u) flags %ld metric %d mtu %d operative %d",
+ __func__, ifp->name, ifp->ifindex, ifp->vrf->name,
+ ifp->vrf->vrf_id, (long)ifp->flags, ifp->metric,
+ ifp->mtu, if_is_operative(ifp));
}
if (if_is_operative(ifp)) {
@@ -1622,13 +1618,13 @@ int pim_ifp_up(struct interface *ifp)
if (PIM_DEBUG_ZEBRA) {
zlog_debug(
- "%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
- __func__, ifp->name, ifp->ifindex, ifp->vrf_id,
- (long)ifp->flags, ifp->metric, ifp->mtu,
- if_is_operative(ifp));
+ "%s: %s index %d vrf %s(%u) flags %ld metric %d mtu %d operative %d",
+ __func__, ifp->name, ifp->ifindex, ifp->vrf->name,
+ ifp->vrf->vrf_id, (long)ifp->flags, ifp->metric,
+ ifp->mtu, if_is_operative(ifp));
}
- pim = pim_get_pim_instance(ifp->vrf_id);
+ pim = ifp->vrf->info;
pim_ifp = ifp->info;
/*
@@ -1653,7 +1649,7 @@ int pim_ifp_up(struct interface *ifp)
struct vrf *vrf;
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if ((table_id == vrf->data.l.table_id)
- && (ifp->vrf_id != vrf->vrf_id)) {
+ && (ifp->vrf->vrf_id != vrf->vrf_id)) {
struct interface *master = if_lookup_by_name(
vrf->name, vrf->vrf_id);
@@ -1674,10 +1670,10 @@ int pim_ifp_down(struct interface *ifp)
{
if (PIM_DEBUG_ZEBRA) {
zlog_debug(
- "%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
- __func__, ifp->name, ifp->ifindex, ifp->vrf_id,
- (long)ifp->flags, ifp->metric, ifp->mtu,
- if_is_operative(ifp));
+ "%s: %s index %d vrf %s(%u) flags %ld metric %d mtu %d operative %d",
+ __func__, ifp->name, ifp->ifindex, ifp->vrf->name,
+ ifp->vrf->vrf_id, (long)ifp->flags, ifp->metric,
+ ifp->mtu, if_is_operative(ifp));
}
if (!if_is_operative(ifp)) {
@@ -1710,16 +1706,16 @@ int pim_ifp_destroy(struct interface *ifp)
if (PIM_DEBUG_ZEBRA) {
zlog_debug(
- "%s: %s index %d(%u) flags %ld metric %d mtu %d operative %d",
- __func__, ifp->name, ifp->ifindex, ifp->vrf_id,
- (long)ifp->flags, ifp->metric, ifp->mtu,
- if_is_operative(ifp));
+ "%s: %s index %d vrf %s(%u) flags %ld metric %d mtu %d operative %d",
+ __func__, ifp->name, ifp->ifindex, ifp->vrf->name,
+ ifp->vrf->vrf_id, (long)ifp->flags, ifp->metric,
+ ifp->mtu, if_is_operative(ifp));
}
if (!if_is_operative(ifp))
pim_if_addr_del_all(ifp);
- pim = pim_get_pim_instance(ifp->vrf_id);
+ pim = ifp->vrf->info;
if (pim && pim->vxlan.term_if == ifp)
pim_vxlan_del_term_dev(pim);
diff --git a/pimd/pim_igmp.c b/pimd/pim_igmp.c
index cd905b3cb..68b3af72a 100644
--- a/pimd/pim_igmp.c
+++ b/pimd/pim_igmp.c
@@ -324,7 +324,7 @@ static int igmp_recv_query(struct igmp_sock *igmp, int query_version,
return 0;
}
- if (if_address_is_local(&from, AF_INET, ifp->vrf_id)) {
+ if (if_address_is_local(&from, AF_INET, ifp->vrf->vrf_id)) {
if (PIM_DEBUG_IGMP_PACKETS)
zlog_debug("Recv IGMP query on interface: %s from ourself %s",
ifp->name, from_str);
diff --git a/pimd/pim_static.c b/pimd/pim_static.c
index 63a9a0065..be06a25be 100644
--- a/pimd/pim_static.c
+++ b/pimd/pim_static.c
@@ -92,7 +92,7 @@ int pim_static_add(struct pim_instance *pim, struct interface *iif,
return -4;
}
#endif
- if (iif->vrf_id != oif->vrf_id) {
+ if (iif->vrf->vrf_id != oif->vrf->vrf_id) {
return -3;
}