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__,
#include "pim_rpf.h"
#include "pim_macro.h"
#include "pim_oil.h"
+#include "pim_upstream.h"
/*
* A (*,G) or a (*,*) is going away
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;
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__,
return;
}
- ch = pim_ifchannel_add(ifp, sg);
+ ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_PIM);
if (!ch)
return;
return;
}
- ch = pim_ifchannel_add(ifp, sg);
+ ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_PIM);
if (!ch)
return;
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;
}
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,
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",
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)
*/
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");
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,
ifp->name, first_ifindex, addr_str);
}
- if (neighbor_needed)
+ if (neighbor_needed && !pim_if_connected_to_source (ifp, addr))
{
struct pim_neighbor *nbr;
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;
}
}
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;
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;
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;
}
}
struct pim_upstream *pim_upstream_add(struct prefix_sg *sg,
- struct interface *incoming)
+ struct interface *incoming,
+ int flags)
{
struct pim_upstream *up;
++up->ref_count;
}
else {
- up = pim_upstream_new(sg, incoming);
+ up = pim_upstream_new(sg, incoming, flags);
}
return 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);