summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-09-15 22:50:08 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:10 +0100
commit4a40c37aa4d4a4480e992bfa5b3e9234abc90c61 (patch)
tree7f9bb8abffb1eb0fc24ccf2a4003fc59f237e9b2
parentpimd: Add debug messages as to why a register packet is rejected. (diff)
downloadfrr-4a40c37aa4d4a4480e992bfa5b3e9234abc90c61.tar.xz
frr-4a40c37aa4d4a4480e992bfa5b3e9234abc90c61.zip
pimd: Further work to fix rpf lookups and nbrs
When we do a RPF lookup return a path that we have neighbors for in those cases where we need to have a neighbor to pass along the SG state via a pim join/prune message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--pimd/pim_assert.c2
-rw-r--r--pimd/pim_ifchannel.c11
-rw-r--r--pimd/pim_ifchannel.h2
-rw-r--r--pimd/pim_mroute.c4
-rw-r--r--pimd/pim_register.c2
-rw-r--r--pimd/pim_rpf.c7
-rw-r--r--pimd/pim_upstream.c13
-rw-r--r--pimd/pim_upstream.h2
8 files changed, 25 insertions, 18 deletions
diff --git a/pimd/pim_assert.c b/pimd/pim_assert.c
index 1add2ebb0..481a2851d 100644
--- a/pimd/pim_assert.c
+++ b/pimd/pim_assert.c
@@ -150,7 +150,7 @@ static int dispatch_assert(struct interface *ifp,
memset (&sg, 0, sizeof (struct prefix_sg));
sg.src = source_addr;
sg.grp = group_addr;
- ch = pim_ifchannel_add(ifp, &sg);
+ ch = pim_ifchannel_add(ifp, &sg, 0);
if (!ch) {
zlog_warn("%s: (S,G)=%s failure creating channel on interface %s",
__PRETTY_FUNCTION__,
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index eaf7ab709..1bc10f4cc 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -39,6 +39,7 @@
#include "pim_rpf.h"
#include "pim_macro.h"
#include "pim_oil.h"
+#include "pim_upstream.h"
/*
* A (*,G) or a (*,*) is going away
@@ -366,7 +367,7 @@ pim_ifchannel_find_parent (struct interface *ifp,
struct pim_ifchannel *
pim_ifchannel_add(struct interface *ifp,
- struct prefix_sg *sg)
+ struct prefix_sg *sg, int flags)
{
struct pim_interface *pim_ifp;
struct pim_ifchannel *ch;
@@ -379,7 +380,7 @@ pim_ifchannel_add(struct interface *ifp,
pim_ifp = ifp->info;
zassert(pim_ifp);
- up = pim_upstream_add(sg, NULL);
+ up = pim_upstream_add(sg, NULL, flags);
if (!up) {
zlog_err("%s: could not attach upstream (S,G)=%s on interface %s",
__PRETTY_FUNCTION__,
@@ -615,7 +616,7 @@ void pim_ifchannel_join_add(struct interface *ifp,
return;
}
- ch = pim_ifchannel_add(ifp, sg);
+ ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_PIM);
if (!ch)
return;
@@ -715,7 +716,7 @@ void pim_ifchannel_prune(struct interface *ifp,
return;
}
- ch = pim_ifchannel_add(ifp, sg);
+ ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_PIM);
if (!ch)
return;
@@ -772,7 +773,7 @@ void pim_ifchannel_local_membership_add(struct interface *ifp,
if (!PIM_IF_TEST_PIM(pim_ifp->options))
return;
- ch = pim_ifchannel_add(ifp, sg);
+ ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_IGMP);
if (!ch) {
return;
}
diff --git a/pimd/pim_ifchannel.h b/pimd/pim_ifchannel.h
index 0c3921064..8c542d17f 100644
--- a/pimd/pim_ifchannel.h
+++ b/pimd/pim_ifchannel.h
@@ -105,7 +105,7 @@ void pim_ifchannel_delete_on_noinfo(struct interface *ifp);
struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,
struct prefix_sg *sg);
struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,
- struct prefix_sg *sg);
+ struct prefix_sg *sg, int flags);
void pim_ifchannel_join_add(struct interface *ifp,
struct in_addr neigh_addr,
struct in_addr upstream,
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index dd3ae3117..8ac1a708b 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -136,7 +136,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg
return 0;
}
- up = pim_upstream_add (&sg, ifp);
+ up = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_FHR);
if (!up) {
if (PIM_DEBUG_MROUTE) {
zlog_debug("%s: Failure to add upstream information for %s",
@@ -363,7 +363,7 @@ pim_mroute_msg_wrvifwhole (int fd, struct interface *ifp, const char *buf)
pim_mroute_add (oil);
if (pim_if_connected_to_source (ifp, sg.src))
{
- up = pim_upstream_add (&sg, ifp);
+ up = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_FHR);
if (!up)
{
if (PIM_DEBUG_MROUTE)
diff --git a/pimd/pim_register.c b/pimd/pim_register.c
index 69a3d6167..c2e666f17 100644
--- a/pimd/pim_register.c
+++ b/pimd/pim_register.c
@@ -333,7 +333,7 @@ pim_register_recv (struct interface *ifp,
*/
if (!upstream)
{
- upstream = pim_upstream_add (&sg, ifp);
+ upstream = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_SRC_STREAM);
if (!upstream)
{
zlog_warn ("Failure to create upstream state");
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 3d88f9e70..46a6ef1ca 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -46,7 +46,6 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
int found = 0;
int i = 0;
- neighbor_needed = 0;
memset (nexthop_tab, 0, sizeof (struct pim_zlookup_nexthop) * MULTIPATH_NUM);
num_ifindex = zclient_lookup_nexthop(nexthop_tab,
MULTIPATH_NUM,
@@ -87,7 +86,7 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
ifp->name, first_ifindex, addr_str);
}
- if (neighbor_needed)
+ if (neighbor_needed && !pim_if_connected_to_source (ifp, addr))
{
struct pim_neighbor *nbr;
@@ -148,7 +147,9 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream *up, struct in_addr *old_
save_rpf_addr = rpf->rpf_addr; /* detect change in RPF'(S,G) */
if (pim_nexthop_lookup(&rpf->source_nexthop,
- up->upstream_addr, !PIM_UPSTREAM_FLAG_TEST_FHR (up->flags))) {
+ up->upstream_addr,
+ !PIM_UPSTREAM_FLAG_TEST_FHR (up->flags) &&
+ !PIM_UPSTREAM_FLAG_TEST_SRC_IGMP (up->flags))) {
return PIM_RPF_FAILURE;
}
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index 625795092..b495f3918 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -468,7 +468,8 @@ pim_upstream_switch(struct pim_upstream *up,
}
static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
- struct interface *incoming)
+ struct interface *incoming,
+ int flags)
{
struct pim_upstream *up;
enum pim_rpf_result rpf_result;
@@ -492,7 +493,7 @@ static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
up->parent = pim_upstream_find_parent (sg);
pim_upstream_find_new_children (up);
- up->flags = 0;
+ up->flags = flags;
up->ref_count = 1;
up->t_join_timer = NULL;
up->t_ka_timer = NULL;
@@ -512,6 +513,9 @@ static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
rpf_result = pim_rpf_update(up, NULL);
if (rpf_result == PIM_RPF_FAILURE) {
+ if (PIM_DEBUG_PIM_TRACE)
+ zlog_debug ("%s: Attempting to create upstream(%s), Unable to RPF for source", __PRETTY_FUNCTION__,
+ pim_str_sg_dump (&up->sg));
XFREE(MTYPE_PIM_UPSTREAM, up);
return NULL;
}
@@ -557,7 +561,8 @@ struct pim_upstream *pim_upstream_find(struct prefix_sg *sg)
}
struct pim_upstream *pim_upstream_add(struct prefix_sg *sg,
- struct interface *incoming)
+ struct interface *incoming,
+ int flags)
{
struct pim_upstream *up;
@@ -566,7 +571,7 @@ struct pim_upstream *pim_upstream_add(struct prefix_sg *sg,
++up->ref_count;
}
else {
- up = pim_upstream_new(sg, incoming);
+ up = pim_upstream_new(sg, incoming, flags);
}
return up;
diff --git a/pimd/pim_upstream.h b/pimd/pim_upstream.h
index 6d30349bd..3c9862fe9 100644
--- a/pimd/pim_upstream.h
+++ b/pimd/pim_upstream.h
@@ -113,7 +113,7 @@ void pim_upstream_delete(struct pim_upstream *up);
struct pim_upstream *pim_upstream_find (struct prefix_sg *sg);
struct pim_upstream *pim_upstream_find_non_any (struct prefix_sg *sg);
struct pim_upstream *pim_upstream_add (struct prefix_sg *sg,
- struct interface *ifp);
+ struct interface *ifp, int);
void pim_upstream_del(struct pim_upstream *up);
int pim_upstream_evaluate_join_desired(struct pim_upstream *up);