summaryrefslogtreecommitdiff
path: root/pimd/pim_iface.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-10-24 15:09:18 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-12-04 14:23:20 -0500
commit85d25587bfd551e4ce39501dd54a07c4325bb7ae (patch)
treeafd6960e0cff1b508b26795547ca28aeb814e268 /pimd/pim_iface.c
parentc84355a93212939e98084137aa927ab911305614 (diff)
eigrpd, ospfd, pimd: Fix assumption that interface may not be up
Commit: ddbf3e60604019d4b38d51226700e2244cc531b6 This commit modified the interface up handling code in ZAPI such that the zclient handled the decoding for you. Prior to this commit ospf assumed that it could use the old ifp pointer to know state before reading the stream. This lead to a situation where ospf would `smartly` track and do the right thing in this situation. This commit changed this assumption and in certain scenarios, say a interface was changed after it was already up would lead to situations where ospf would not properly handle the new interface up. Modify ospf to track data that is important to it in it's interface->info pointer. This code pattern was followed in both eigrp and pim. In eigrp's case it was just behaving weirdly in any event so fixing this pattern is not a big deal. In pim's case it was not properly using this so it's a no-op to fix. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_iface.c')
-rw-r--r--pimd/pim_iface.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c
index 3ee9caebcf..c615540149 100644
--- a/pimd/pim_iface.c
+++ b/pimd/pim_iface.c
@@ -1481,6 +1481,13 @@ void pim_if_create_pimreg(struct pim_instance *pim)
pim_if_new(pim->regiface, false, false, true,
false /*vxlan_term*/);
+ /*
+ * On vrf moves we delete the interface if there
+ * is nothing going on with it. We cannot have
+ * the pimregiface deleted.
+ */
+ pim->regiface->configured = true;
+
}
}
@@ -1581,6 +1588,7 @@ int pim_ifp_create(struct interface *ifp)
int pim_ifp_up(struct interface *ifp)
{
+ struct pim_interface *pim_ifp;
struct pim_instance *pim;
uint32_t table_id;
@@ -1593,24 +1601,21 @@ int pim_ifp_up(struct interface *ifp)
}
pim = pim_get_pim_instance(ifp->vrf_id);
- if (if_is_operative(ifp)) {
- struct pim_interface *pim_ifp;
- pim_ifp = ifp->info;
- /*
- * If we have a pim_ifp already and this is an if_add
- * that means that we probably have a vrf move event
- * If that is the case, set the proper vrfness.
- */
- if (pim_ifp)
- pim_ifp->pim = pim;
+ pim_ifp = ifp->info;
+ /*
+ * If we have a pim_ifp already and this is an if_add
+ * that means that we probably have a vrf move event
+ * If that is the case, set the proper vrfness.
+ */
+ if (pim_ifp)
+ pim_ifp->pim = pim;
- /*
- pim_if_addr_add_all() suffices for bringing up both IGMP and
- PIM
- */
- pim_if_addr_add_all(ifp);
- }
+ /*
+ pim_if_addr_add_all() suffices for bringing up both IGMP and
+ PIM
+ */
+ pim_if_addr_add_all(ifp);
/*
* If we have a pimreg device callback and it's for a specific