mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 09:46:54 +00:00
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>
This commit is contained in:
parent
a6dc7de682
commit
4a40c37aa4
@ -150,7 +150,7 @@ static int dispatch_assert(struct interface *ifp,
|
|||||||
memset (&sg, 0, sizeof (struct prefix_sg));
|
memset (&sg, 0, sizeof (struct prefix_sg));
|
||||||
sg.src = source_addr;
|
sg.src = source_addr;
|
||||||
sg.grp = group_addr;
|
sg.grp = group_addr;
|
||||||
ch = pim_ifchannel_add(ifp, &sg);
|
ch = pim_ifchannel_add(ifp, &sg, 0);
|
||||||
if (!ch) {
|
if (!ch) {
|
||||||
zlog_warn("%s: (S,G)=%s failure creating channel on interface %s",
|
zlog_warn("%s: (S,G)=%s failure creating channel on interface %s",
|
||||||
__PRETTY_FUNCTION__,
|
__PRETTY_FUNCTION__,
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include "pim_rpf.h"
|
#include "pim_rpf.h"
|
||||||
#include "pim_macro.h"
|
#include "pim_macro.h"
|
||||||
#include "pim_oil.h"
|
#include "pim_oil.h"
|
||||||
|
#include "pim_upstream.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A (*,G) or a (*,*) is going away
|
* A (*,G) or a (*,*) is going away
|
||||||
@ -366,7 +367,7 @@ pim_ifchannel_find_parent (struct interface *ifp,
|
|||||||
|
|
||||||
struct pim_ifchannel *
|
struct pim_ifchannel *
|
||||||
pim_ifchannel_add(struct interface *ifp,
|
pim_ifchannel_add(struct interface *ifp,
|
||||||
struct prefix_sg *sg)
|
struct prefix_sg *sg, int flags)
|
||||||
{
|
{
|
||||||
struct pim_interface *pim_ifp;
|
struct pim_interface *pim_ifp;
|
||||||
struct pim_ifchannel *ch;
|
struct pim_ifchannel *ch;
|
||||||
@ -379,7 +380,7 @@ pim_ifchannel_add(struct interface *ifp,
|
|||||||
pim_ifp = ifp->info;
|
pim_ifp = ifp->info;
|
||||||
zassert(pim_ifp);
|
zassert(pim_ifp);
|
||||||
|
|
||||||
up = pim_upstream_add(sg, NULL);
|
up = pim_upstream_add(sg, NULL, flags);
|
||||||
if (!up) {
|
if (!up) {
|
||||||
zlog_err("%s: could not attach upstream (S,G)=%s on interface %s",
|
zlog_err("%s: could not attach upstream (S,G)=%s on interface %s",
|
||||||
__PRETTY_FUNCTION__,
|
__PRETTY_FUNCTION__,
|
||||||
@ -615,7 +616,7 @@ void pim_ifchannel_join_add(struct interface *ifp,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ch = pim_ifchannel_add(ifp, sg);
|
ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_PIM);
|
||||||
if (!ch)
|
if (!ch)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -715,7 +716,7 @@ void pim_ifchannel_prune(struct interface *ifp,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ch = pim_ifchannel_add(ifp, sg);
|
ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_PIM);
|
||||||
if (!ch)
|
if (!ch)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -772,7 +773,7 @@ void pim_ifchannel_local_membership_add(struct interface *ifp,
|
|||||||
if (!PIM_IF_TEST_PIM(pim_ifp->options))
|
if (!PIM_IF_TEST_PIM(pim_ifp->options))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ch = pim_ifchannel_add(ifp, sg);
|
ch = pim_ifchannel_add(ifp, sg, PIM_UPSTREAM_FLAG_MASK_SRC_IGMP);
|
||||||
if (!ch) {
|
if (!ch) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ void pim_ifchannel_delete_on_noinfo(struct interface *ifp);
|
|||||||
struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,
|
struct pim_ifchannel *pim_ifchannel_find(struct interface *ifp,
|
||||||
struct prefix_sg *sg);
|
struct prefix_sg *sg);
|
||||||
struct pim_ifchannel *pim_ifchannel_add(struct interface *ifp,
|
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,
|
void pim_ifchannel_join_add(struct interface *ifp,
|
||||||
struct in_addr neigh_addr,
|
struct in_addr neigh_addr,
|
||||||
struct in_addr upstream,
|
struct in_addr upstream,
|
||||||
|
@ -136,7 +136,7 @@ pim_mroute_msg_nocache (int fd, struct interface *ifp, const struct igmpmsg *msg
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
up = pim_upstream_add (&sg, ifp);
|
up = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_FHR);
|
||||||
if (!up) {
|
if (!up) {
|
||||||
if (PIM_DEBUG_MROUTE) {
|
if (PIM_DEBUG_MROUTE) {
|
||||||
zlog_debug("%s: Failure to add upstream information for %s",
|
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);
|
pim_mroute_add (oil);
|
||||||
if (pim_if_connected_to_source (ifp, sg.src))
|
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 (!up)
|
||||||
{
|
{
|
||||||
if (PIM_DEBUG_MROUTE)
|
if (PIM_DEBUG_MROUTE)
|
||||||
|
@ -333,7 +333,7 @@ pim_register_recv (struct interface *ifp,
|
|||||||
*/
|
*/
|
||||||
if (!upstream)
|
if (!upstream)
|
||||||
{
|
{
|
||||||
upstream = pim_upstream_add (&sg, ifp);
|
upstream = pim_upstream_add (&sg, ifp, PIM_UPSTREAM_FLAG_MASK_SRC_STREAM);
|
||||||
if (!upstream)
|
if (!upstream)
|
||||||
{
|
{
|
||||||
zlog_warn ("Failure to create upstream state");
|
zlog_warn ("Failure to create upstream state");
|
||||||
|
@ -46,7 +46,6 @@ int pim_nexthop_lookup(struct pim_nexthop *nexthop, struct in_addr addr, int nei
|
|||||||
int found = 0;
|
int found = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
neighbor_needed = 0;
|
|
||||||
memset (nexthop_tab, 0, sizeof (struct pim_zlookup_nexthop) * MULTIPATH_NUM);
|
memset (nexthop_tab, 0, sizeof (struct pim_zlookup_nexthop) * MULTIPATH_NUM);
|
||||||
num_ifindex = zclient_lookup_nexthop(nexthop_tab,
|
num_ifindex = zclient_lookup_nexthop(nexthop_tab,
|
||||||
MULTIPATH_NUM,
|
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);
|
ifp->name, first_ifindex, addr_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (neighbor_needed)
|
if (neighbor_needed && !pim_if_connected_to_source (ifp, addr))
|
||||||
{
|
{
|
||||||
struct pim_neighbor *nbr;
|
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) */
|
save_rpf_addr = rpf->rpf_addr; /* detect change in RPF'(S,G) */
|
||||||
|
|
||||||
if (pim_nexthop_lookup(&rpf->source_nexthop,
|
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;
|
return PIM_RPF_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -468,7 +468,8 @@ pim_upstream_switch(struct pim_upstream *up,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
|
static struct pim_upstream *pim_upstream_new(struct prefix_sg *sg,
|
||||||
struct interface *incoming)
|
struct interface *incoming,
|
||||||
|
int flags)
|
||||||
{
|
{
|
||||||
struct pim_upstream *up;
|
struct pim_upstream *up;
|
||||||
enum pim_rpf_result rpf_result;
|
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);
|
up->parent = pim_upstream_find_parent (sg);
|
||||||
pim_upstream_find_new_children (up);
|
pim_upstream_find_new_children (up);
|
||||||
up->flags = 0;
|
up->flags = flags;
|
||||||
up->ref_count = 1;
|
up->ref_count = 1;
|
||||||
up->t_join_timer = NULL;
|
up->t_join_timer = NULL;
|
||||||
up->t_ka_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);
|
rpf_result = pim_rpf_update(up, NULL);
|
||||||
if (rpf_result == PIM_RPF_FAILURE) {
|
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);
|
XFREE(MTYPE_PIM_UPSTREAM, up);
|
||||||
return NULL;
|
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 pim_upstream *pim_upstream_add(struct prefix_sg *sg,
|
||||||
struct interface *incoming)
|
struct interface *incoming,
|
||||||
|
int flags)
|
||||||
{
|
{
|
||||||
struct pim_upstream *up;
|
struct pim_upstream *up;
|
||||||
|
|
||||||
@ -566,7 +571,7 @@ struct pim_upstream *pim_upstream_add(struct prefix_sg *sg,
|
|||||||
++up->ref_count;
|
++up->ref_count;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
up = pim_upstream_new(sg, incoming);
|
up = pim_upstream_new(sg, incoming, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return up;
|
return up;
|
||||||
|
@ -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 (struct prefix_sg *sg);
|
||||||
struct pim_upstream *pim_upstream_find_non_any (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 pim_upstream *pim_upstream_add (struct prefix_sg *sg,
|
||||||
struct interface *ifp);
|
struct interface *ifp, int);
|
||||||
void pim_upstream_del(struct pim_upstream *up);
|
void pim_upstream_del(struct pim_upstream *up);
|
||||||
|
|
||||||
int pim_upstream_evaluate_join_desired(struct pim_upstream *up);
|
int pim_upstream_evaluate_join_desired(struct pim_upstream *up);
|
||||||
|
Loading…
Reference in New Issue
Block a user