summaryrefslogtreecommitdiffstats
path: root/pimd/pim_msg.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-11-07 16:40:26 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-12-22 02:26:14 +0100
commit1c01dbd8f8bc8adbcf61f3894ca0efec49656a40 (patch)
treed96d3702b19e39126e46bf979b53e788e7dfebe2 /pimd/pim_msg.c
parentpim-msdp: part-2: SA cache support (diff)
downloadfrr-1c01dbd8f8bc8adbcf61f3894ca0efec49656a40.tar.xz
frr-1c01dbd8f8bc8adbcf61f3894ca0efec49656a40.zip
pimd: Send prune(S,G,RPT) with (*,G) join
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'pimd/pim_msg.c')
-rw-r--r--pimd/pim_msg.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/pimd/pim_msg.c b/pimd/pim_msg.c
index f58aec858..c22011b57 100644
--- a/pimd/pim_msg.c
+++ b/pimd/pim_msg.c
@@ -204,11 +204,13 @@ pim_msg_join_prune_encode (uint8_t *buf, int buf_size, int is_join,
__PRETTY_FUNCTION__, source_str, remain);
return -7;
}
+ remain = pim_msg_curr - pim_msg;
if (up->sg.src.s_addr == INADDR_ANY)
{
struct pim_upstream *child;
struct listnode *up_node;
+ int send_prune = 0;
char star_g[100];
strcpy (star_g, pim_str_sg_dump (&up->sg));
@@ -220,6 +222,7 @@ pim_msg_join_prune_encode (uint8_t *buf, int buf_size, int is_join,
{
if (!pim_rpf_is_same(&up->rpf, &child->rpf))
{
+ send_prune = 1;
if (PIM_DEBUG_PIM_PACKETS)
zlog_debug ("%s: SPT Bit and RPF'(%s) != RPF'(S,G): Add Prune (%s,rpt) to compound message",
__PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg));
@@ -233,12 +236,14 @@ pim_msg_join_prune_encode (uint8_t *buf, int buf_size, int is_join,
{
if (pim_upstream_empty_inherited_olist (child))
{
+ send_prune = 1;
if (PIM_DEBUG_PIM_PACKETS)
zlog_debug ("%s: inherited_olist(%s,rpt) is NULL, Add Prune to compound message",
__PRETTY_FUNCTION__, pim_str_sg_dump (&child->sg));
}
else if (!pim_rpf_is_same (&up->rpf, &child->rpf))
{
+ send_prune = 1;
if (PIM_DEBUG_PIM_PACKETS)
zlog_debug ("%s: RPF'(%s) != RPF'(%s,rpt), Add Prune to compound message",
__PRETTY_FUNCTION__, star_g, pim_str_sg_dump (&child->sg));
@@ -252,10 +257,18 @@ pim_msg_join_prune_encode (uint8_t *buf, int buf_size, int is_join,
if (PIM_DEBUG_PIM_PACKETS)
zlog_debug ("%s: SPT bit is not set for (%s)",
__PRETTY_FUNCTION__, pim_str_sg_dump (&child->sg));
+ if (send_prune)
+ {
+ pim_msg_curr = pim_msg_addr_encode_ipv4_source (pim_msg_curr, remain,
+ child->sg.src,
+ PIM_ENCODE_SPARSE_BIT | PIM_ENCODE_RPT_BIT);
+ remain = pim_msg_curr - pim_msg;
+ *prunes = htons(ntohs(*prunes) + 1);
+ send_prune = 0;
+ }
}
}
- remain = pim_msg_curr - pim_msg;
pim_msg_build_header (pim_msg, remain, PIM_MSG_TYPE_JOIN_PRUNE);
return remain;