summaryrefslogtreecommitdiff
path: root/pimd/pim_join.c
diff options
context:
space:
mode:
Diffstat (limited to 'pimd/pim_join.c')
-rw-r--r--pimd/pim_join.c79
1 files changed, 38 insertions, 41 deletions
diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 6ba18d540a..f54d5bf9bf 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -64,7 +64,7 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
sizeof(neigh_str));
zlog_debug(
"%s: join (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s",
- __PRETTY_FUNCTION__, pim_str_sg_dump(sg),
+ __func__, pim_str_sg_dump(sg),
!!(source_flags & PIM_RPT_BIT_MASK),
!!(source_flags & PIM_WILDCARD_BIT_MASK), up_str,
holdtime, neigh_str, ifp->name);
@@ -84,8 +84,8 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
if (!rp) {
- zlog_warn("%s: Lookup of RP failed for %pSG4",
- __PRETTY_FUNCTION__, sg);
+ zlog_warn("%s: Lookup of RP failed for %pSG4", __func__,
+ sg);
return;
}
/*
@@ -99,8 +99,9 @@ static void recv_join(struct interface *ifp, struct pim_neighbor *neigh,
sizeof(received_rp));
pim_inet4_dump("<local?>", rp->rpf_addr.u.prefix4,
local_rp, sizeof(local_rp));
- zlog_warn("%s: Specified RP(%s) in join is different than our configured RP(%s)",
- __PRETTY_FUNCTION__, received_rp, local_rp);
+ zlog_warn(
+ "%s: Specified RP(%s) in join is different than our configured RP(%s)",
+ __func__, received_rp, local_rp);
return;
}
@@ -126,7 +127,7 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
sizeof(neigh_str));
zlog_debug(
"%s: prune (S,G)=%s rpt=%d wc=%d upstream=%s holdtime=%d from %s on %s",
- __PRETTY_FUNCTION__, pim_str_sg_dump(sg),
+ __func__, pim_str_sg_dump(sg),
source_flags & PIM_RPT_BIT_MASK,
source_flags & PIM_WILDCARD_BIT_MASK, up_str, holdtime,
neigh_str, ifp->name);
@@ -139,17 +140,19 @@ static void recv_prune(struct interface *ifp, struct pim_neighbor *neigh,
if ((source_flags & PIM_RPT_BIT_MASK)
&& (source_flags & PIM_WILDCARD_BIT_MASK)) {
- struct pim_rpf *rp = RP(pim_ifp->pim, sg->grp);
+ /*
+ * RFC 4601 Section 4.5.2:
+ * Received Prune(*,G) messages are processed even if the
+ * RP in the message does not match RP(G).
+ */
+ if (PIM_DEBUG_PIM_TRACE) {
+ char received_rp[INET_ADDRSTRLEN];
- if (!rp) {
- if (PIM_DEBUG_PIM_TRACE)
- zlog_debug("%s: RP for %pSG4 completely failed lookup",
- __PRETTY_FUNCTION__, sg);
- return;
+ pim_inet4_dump("<received?>", sg->src, received_rp,
+ sizeof(received_rp));
+ zlog_debug("%s: Prune received with RP(%s) for %pSG4",
+ __func__, received_rp, sg);
}
- // Ignoring Prune *,G's at the moment.
- if (sg->src.s_addr != rp->rpf_addr.u.prefix4.s_addr)
- return;
sg->src.s_addr = INADDR_ANY;
}
@@ -186,7 +189,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
char src_str[INET_ADDRSTRLEN];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
zlog_warn("%s: pim_parse_addr_ucast() failure: from %s on %s",
- __PRETTY_FUNCTION__, src_str, ifp->name);
+ __func__, src_str, ifp->name);
return -1;
}
buf += addr_offset;
@@ -197,9 +200,9 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
if (msg_upstream_addr.family != AF_INET) {
char src_str[INET_ADDRSTRLEN];
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
- zlog_warn("%s: ignoring join/prune directed to unexpected addr family=%d from %s on %s",
- __PRETTY_FUNCTION__, msg_upstream_addr.family,
- src_str, ifp->name);
+ zlog_warn(
+ "%s: ignoring join/prune directed to unexpected addr family=%d from %s on %s",
+ __func__, msg_upstream_addr.family, src_str, ifp->name);
return -2;
}
@@ -209,7 +212,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
pim_inet4_dump("<src?>", src_addr, src_str, sizeof(src_str));
zlog_warn(
"%s: short join/prune message buffer for group list: size=%d minimum=%d from %s on %s",
- __PRETTY_FUNCTION__, remain, 4, src_str, ifp->name);
+ __func__, remain, 4, src_str, ifp->name);
return -4;
}
@@ -228,8 +231,8 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
upstream_str, sizeof(upstream_str));
zlog_debug(
"%s: join/prune upstream=%s groups=%d holdtime=%d from %s on %s",
- __PRETTY_FUNCTION__, upstream_str, msg_num_groups,
- msg_holdtime, src_str, ifp->name);
+ __func__, upstream_str, msg_num_groups, msg_holdtime,
+ src_str, ifp->name);
}
/* Scan groups */
@@ -256,8 +259,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
sizeof(src_str));
zlog_warn(
"%s: short join/prune buffer for source list: size=%d minimum=%d from %s on %s",
- __PRETTY_FUNCTION__, remain, 4, src_str,
- ifp->name);
+ __func__, remain, 4, src_str, ifp->name);
return -6;
}
@@ -278,7 +280,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
sizeof(group_str));
zlog_debug(
"%s: join/prune upstream=%s group=%s/32 join_src=%d prune_src=%d from %s on %s",
- __PRETTY_FUNCTION__, upstream_str, group_str,
+ __func__, upstream_str, group_str,
msg_num_joined_sources, msg_num_pruned_sources,
src_str, ifp->name);
}
@@ -362,8 +364,7 @@ int pim_joinprune_recv(struct interface *ifp, struct pim_neighbor *neigh,
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: SGRpt flag is set, del inherit oif from up %s",
- __PRETTY_FUNCTION__,
- up->sg_str);
+ __func__, up->sg_str);
pim_channel_del_inherited_oif(
up->channel_oil,
starg_ch->interface,
@@ -462,17 +463,15 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
if (rpf->source_nexthop.interface)
pim_ifp = rpf->source_nexthop.interface->info;
else {
- zlog_warn("%s: RPF interface is not present",
- __PRETTY_FUNCTION__);
+ zlog_warn("%s: RPF interface is not present", __func__);
return -1;
}
- on_trace(__PRETTY_FUNCTION__, rpf->source_nexthop.interface,
- rpf->rpf_addr.u.prefix4);
+ on_trace(__func__, rpf->source_nexthop.interface,
+ rpf->rpf_addr.u.prefix4);
if (!pim_ifp) {
- zlog_warn("%s: multicast not enabled on interface %s",
- __PRETTY_FUNCTION__,
+ zlog_warn("%s: multicast not enabled on interface %s", __func__,
rpf->source_nexthop.interface->name);
return -1;
}
@@ -483,7 +482,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
pim_inet4_dump("<dst?>", rpf->rpf_addr.u.prefix4,
dst_str, sizeof(dst_str));
zlog_debug("%s: upstream=%s is myself on interface %s",
- __PRETTY_FUNCTION__, dst_str,
+ __func__, dst_str,
rpf->source_nexthop.interface->name);
}
return 0;
@@ -532,7 +531,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
sizeof(grp_str));
zlog_debug(
"%s: sending (G)=%s to upstream=%s on interface %s",
- __PRETTY_FUNCTION__, grp_str, dst_str,
+ __func__, grp_str, dst_str,
rpf->source_nexthop.interface->name);
}
@@ -547,7 +546,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
rpf->source_nexthop.interface->name)) {
zlog_warn(
"%s: could not send PIM message on interface %s",
- __PRETTY_FUNCTION__,
+ __func__,
rpf->source_nexthop.interface->name);
}
@@ -588,8 +587,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
if (PIM_DEBUG_PIM_TRACE)
zlog_debug(
"%s: interface %s num_joins %u num_prunes %u",
- __PRETTY_FUNCTION__,
- rpf->source_nexthop.interface->name,
+ __func__, rpf->source_nexthop.interface->name,
ntohs(grp->joins), ntohs(grp->prunes));
grp = (struct pim_jp_groups *)curr_ptr;
@@ -604,7 +602,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
rpf->source_nexthop.interface->name)) {
zlog_warn(
"%s: could not send PIM message on interface %s",
- __PRETTY_FUNCTION__,
+ __func__,
rpf->source_nexthop.interface->name);
}
@@ -623,8 +621,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
rpf->source_nexthop.interface->name)) {
zlog_warn(
"%s: could not send PIM message on interface %s",
- __PRETTY_FUNCTION__,
- rpf->source_nexthop.interface->name);
+ __func__, rpf->source_nexthop.interface->name);
}
}
return 0;