summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-06-06 17:37:41 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-06-06 17:37:41 +0200
commit326452238a0f2610b778678fd639730c7bdd40fb (patch)
treefe95eb5109b8c696274e873b4922fc5562c6a64c
parentfa135ba00813984f1f0d601b8f7930d4efaefe07 (diff)
parentf87b96392c19d18342f0f986858409b10875fcbd (diff)
Merge branch 'stable/3.0'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
-rw-r--r--bgpd/bgp_vty.c1
-rw-r--r--ospf6d/ospf6_area.c30
-rw-r--r--ospfd/ospf_vty.c9
-rw-r--r--pimd/pim_ifchannel.c23
-rw-r--r--pimd/pim_ifchannel.h2
-rw-r--r--pimd/pim_join.c39
-rw-r--r--pimd/pim_rpf.c13
-rw-r--r--pimd/pim_upstream.c5
-rw-r--r--vtysh/vtysh.c5
9 files changed, 78 insertions, 49 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index c2942b50dc..ec53e19330 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -12244,6 +12244,7 @@ lcommunity_list_set_vty (struct vty *vty, int argc, struct cmd_token **argv,
return CMD_WARNING;
}
+ idx = 0;
argv_find (argv, argc, "AA:BB:CC", &idx);
argv_find (argv, argc, "LINE", &idx);
/* Concat community string argument. */
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index e652a71bb6..deb2c07700 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -619,21 +619,23 @@ DEFUN (area_filter_list,
"Filter networks sent to this area\n"
"Filter networks sent from this area\n")
{
- int idx_ipv4 = 1;
- int idx_word = 4;
+ char *inout = argv[argc - 1]->text;
+ char *areaid = argv[1]->arg;
+ char *plistname = argv[4]->arg;
+
struct ospf6_area *area;
struct prefix_list *plist;
- OSPF6_CMD_AREA_GET (argv[idx_ipv4]->arg, area);
+ OSPF6_CMD_AREA_GET (areaid, area);
- plist = prefix_list_lookup (AFI_IP6, argv[idx_ipv4]->arg);
- if (strncmp (argv[idx_word]->arg, "in", 2) == 0)
+ plist = prefix_list_lookup (AFI_IP6, plistname);
+ if (strmatch (inout, "in"))
{
PREFIX_LIST_IN (area) = plist;
if (PREFIX_NAME_IN (area))
free (PREFIX_NAME_IN (area));
- PREFIX_NAME_IN (area) = strdup (argv[idx_ipv4]->arg);
+ PREFIX_NAME_IN (area) = strdup (plistname);
ospf6_abr_reimport (area);
}
else
@@ -642,7 +644,7 @@ DEFUN (area_filter_list,
if (PREFIX_NAME_OUT (area))
free (PREFIX_NAME_OUT (area));
- PREFIX_NAME_OUT (area) = strdup (argv[idx_ipv4]->arg);
+ PREFIX_NAME_OUT (area) = strdup (plistname);
ospf6_abr_enable_area (area);
}
@@ -661,16 +663,18 @@ DEFUN (no_area_filter_list,
"Filter networks sent to this area\n"
"Filter networks sent from this area\n")
{
- int idx_ipv4 = 2;
- int idx_word = 5;
+ char *inout = argv[argc - 1]->text;
+ char *areaid = argv[2]->arg;
+ char *plistname = argv[5]->arg;
+
struct ospf6_area *area;
- OSPF6_CMD_AREA_GET (argv[idx_ipv4]->arg, area);
+ OSPF6_CMD_AREA_GET (areaid, area);
- if (strncmp (argv[idx_word]->arg, "in", 2) == 0)
+ if (strmatch (inout, "in"))
{
if (PREFIX_NAME_IN (area))
- if (strcmp (PREFIX_NAME_IN (area), argv[idx_ipv4]->arg) != 0)
+ if (!strmatch (PREFIX_NAME_IN (area), plistname))
return CMD_SUCCESS;
PREFIX_LIST_IN (area) = NULL;
@@ -683,7 +687,7 @@ DEFUN (no_area_filter_list,
else
{
if (PREFIX_NAME_OUT (area))
- if (strcmp (PREFIX_NAME_OUT (area), argv[idx_ipv4]->arg) != 0)
+ if (!strmatch (PREFIX_NAME_OUT (area), plistname))
return CMD_SUCCESS;
PREFIX_LIST_OUT (area) = NULL;
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index 37fb2da9df..99c8368a5f 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -3535,7 +3535,6 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
if (use_json)
{
json = json_object_new_object();
- json_interface_sub = json_object_new_object();
}
if (ospf->instance)
@@ -3554,7 +3553,11 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
{
if (ospf_oi_count(ifp))
{
+ if (use_json)
+ json_interface_sub = json_object_new_object();
+
show_ip_ospf_interface_sub (vty, ospf, ifp, json_interface_sub, use_json);
+
if (use_json)
json_object_object_add (json, ifp->name, json_interface_sub);
}
@@ -3572,7 +3575,11 @@ show_ip_ospf_interface_common (struct vty *vty, struct ospf *ospf, int argc,
}
else
{
+ if (use_json)
+ json_interface_sub = json_object_new_object();
+
show_ip_ospf_interface_sub (vty, ospf, ifp, json_interface_sub, use_json);
+
if (use_json)
json_object_object_add(json, ifp->name, json_interface_sub);
}
diff --git a/pimd/pim_ifchannel.c b/pimd/pim_ifchannel.c
index 6dc607e1bc..021722dfc2 100644
--- a/pimd/pim_ifchannel.c
+++ b/pimd/pim_ifchannel.c
@@ -1279,7 +1279,7 @@ pim_ifchannel_scan_forward_start (struct interface *new_ifp)
* we get End of Message
*/
void
-pim_ifchannel_set_star_g_join_state (struct pim_ifchannel *ch, int eom, uint8_t source_flags, uint8_t join)
+pim_ifchannel_set_star_g_join_state (struct pim_ifchannel *ch, int eom, uint8_t source_flags, uint8_t join, uint8_t starg_alone)
{
struct pim_ifchannel *child;
struct listnode *ch_node;
@@ -1294,10 +1294,11 @@ pim_ifchannel_set_star_g_join_state (struct pim_ifchannel *ch, int eom, uint8_t
for (ALL_LIST_ELEMENTS_RO (ch->sources, ch_node, child))
{
/* Only *,G Join received and no (SG-RPT) prune.
+ eom = 1, only (W,G) join_alone is true, WC and RPT are set.
Scan all S,G associated to G and if any SG-RPT
remove the SG-RPT flag.
*/
- if (join && (source_flags & PIM_RPT_BIT_MASK) &&
+ if (eom && starg_alone && (source_flags & PIM_RPT_BIT_MASK) &&
(source_flags & PIM_WILDCARD_BIT_MASK))
{
if (PIM_IF_FLAG_TEST_S_G_RPT(child->flags))
@@ -1308,25 +1309,13 @@ pim_ifchannel_set_star_g_join_state (struct pim_ifchannel *ch, int eom, uint8_t
if (up)
{
if (PIM_DEBUG_TRACE)
- zlog_debug ("%s: clearing SGRpt flag, add inherit oif to up %s ", __PRETTY_FUNCTION__, up->sg_str);
+ zlog_debug ("%s: SGRpt flag is cleared, add inherit oif to up %s",
+ __PRETTY_FUNCTION__, up->sg_str);
pim_channel_add_oif (up->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_STAR);
+ pim_ifchannel_ifjoin_switch(__PRETTY_FUNCTION__, child, PIM_IFJOIN_JOIN);
}
}
}
- /* Received SG-RPT Prune delete oif from S,G */
- else if (join == 0 && (source_flags & PIM_RPT_BIT_MASK) &&
- !(source_flags & PIM_WILDCARD_BIT_MASK))
- {
- struct pim_upstream *up = child->upstream;
-
- PIM_IF_FLAG_SET_S_G_RPT(child->flags);
- if (up)
- {
- if (PIM_DEBUG_TRACE)
- zlog_debug ("%s: SGRpt Set, del inherit oif from up %s", __PRETTY_FUNCTION__, up->sg_str);
- pim_channel_del_oif (up->channel_oil, ch->interface, PIM_OIF_FLAG_PROTO_STAR);
- }
- }
if (!PIM_IF_FLAG_TEST_S_G_RPT(child->flags))
continue;
diff --git a/pimd/pim_ifchannel.h b/pimd/pim_ifchannel.h
index e8c2ddd072..455493a5bc 100644
--- a/pimd/pim_ifchannel.h
+++ b/pimd/pim_ifchannel.h
@@ -150,7 +150,7 @@ void pim_ifchannel_update_my_assert_metric(struct pim_ifchannel *ch);
void pim_ifchannel_update_assert_tracking_desired(struct pim_ifchannel *ch);
void pim_ifchannel_scan_forward_start (struct interface *new_ifp);
-void pim_ifchannel_set_star_g_join_state (struct pim_ifchannel *ch, int eom, uint8_t source_flags, uint8_t join);
+void pim_ifchannel_set_star_g_join_state (struct pim_ifchannel *ch, int eom, uint8_t source_flags, uint8_t join, uint8_t starg_alone);
int pim_ifchannel_compare (struct pim_ifchannel *ch1, struct pim_ifchannel *ch2);
diff --git a/pimd/pim_join.c b/pimd/pim_join.c
index 5462dba61d..35deecfd81 100644
--- a/pimd/pim_join.c
+++ b/pimd/pim_join.c
@@ -228,7 +228,8 @@ int pim_joinprune_recv(struct interface *ifp,
uint16_t msg_num_joined_sources;
uint16_t msg_num_pruned_sources;
int source;
- struct pim_ifchannel *ch = NULL;
+ struct pim_ifchannel *starg_ch = NULL, *sg_ch = NULL;
+ uint8_t starg_alone = 0;
memset (&sg, 0, sizeof (struct prefix_sg));
addr_offset = pim_parse_addr_group (&sg,
@@ -287,9 +288,10 @@ int pim_joinprune_recv(struct interface *ifp,
if (sg.src.s_addr == INADDR_ANY)
{
- ch = pim_ifchannel_find (ifp, &sg);
- if (ch)
- pim_ifchannel_set_star_g_join_state (ch, 0, msg_source_flags, 1);
+ starg_alone = 1;
+ starg_ch = pim_ifchannel_find (ifp, &sg);
+ if (starg_ch)
+ pim_ifchannel_set_star_g_join_state (starg_ch, 0, msg_source_flags, 1, starg_alone);
}
}
@@ -302,16 +304,33 @@ int pim_joinprune_recv(struct interface *ifp,
return -8;
}
- buf += addr_offset;
+ sg_ch = pim_ifchannel_find (ifp, &sg);
+ buf += addr_offset;
+ starg_alone = 0;
recv_prune(ifp, neigh, msg_holdtime,
msg_upstream_addr.u.prefix4,
&sg,
msg_source_flags);
+
+ /* Received SG-RPT Prune delete oif from specific S,G */
+ if (starg_ch && sg_ch && (msg_source_flags & PIM_RPT_BIT_MASK)
+ && !(msg_source_flags & PIM_WILDCARD_BIT_MASK))
+ {
+ struct pim_upstream *up = sg_ch->upstream;
+ PIM_IF_FLAG_SET_S_G_RPT(sg_ch->flags);
+ if (up)
+ {
+ if (PIM_DEBUG_TRACE)
+ zlog_debug ("%s: SGRpt flag is set, del inherit oif from up %s",
+ __PRETTY_FUNCTION__, up->sg_str);
+ pim_channel_del_oif (up->channel_oil, starg_ch->interface, PIM_OIF_FLAG_PROTO_STAR);
+ }
+ }
}
- if (ch)
- pim_ifchannel_set_star_g_join_state (ch, 1, msg_source_flags, 0);
- ch = NULL;
+ if (starg_ch)
+ pim_ifchannel_set_star_g_join_state (starg_ch, 1, msg_source_flags, 0, starg_alone);
+ starg_ch = NULL;
} /* scan groups */
return 0;
@@ -518,6 +537,10 @@ int pim_joinprune_send(struct pim_rpf *rpf,
pim_ifp->pim_ifstat_join_send += ntohs(grp->joins);
pim_ifp->pim_ifstat_prune_send += ntohs(grp->prunes);
+ if (PIM_DEBUG_PIM_TRACE)
+ zlog_debug ("%s: interface %s num_joins %u num_prunes %u", __PRETTY_FUNCTION__,
+ rpf->source_nexthop.interface->name, ntohs(grp->joins), ntohs (grp->prunes));
+
grp = (struct pim_jp_groups *)curr_ptr;
if (packet_left < sizeof (struct pim_jp_groups) || msg->num_groups == 255)
{
diff --git a/pimd/pim_rpf.c b/pimd/pim_rpf.c
index 3e72d8df21..c5adf423c4 100644
--- a/pimd/pim_rpf.c
+++ b/pimd/pim_rpf.c
@@ -243,17 +243,18 @@ enum pim_rpf_result pim_rpf_update(struct pim_upstream *up, struct pim_rpf *old,
{
return PIM_RPF_FAILURE;
}
- }
+ }
rpf->rpf_addr.family = AF_INET;
rpf->rpf_addr.u.prefix4 = pim_rpf_find_rpf_addr(up);
- if (pim_rpf_addr_is_inaddr_any(rpf) && PIM_DEBUG_ZEBRA) {
- /* RPF'(S,G) not found */
- zlog_debug("%s %s: RPF'%s not found: won't send join upstream",
+ if (pim_rpf_addr_is_inaddr_any(rpf) && PIM_DEBUG_ZEBRA)
+ {
+ /* RPF'(S,G) not found */
+ zlog_debug("%s %s: RPF'%s not found: won't send join upstream",
__FILE__, __PRETTY_FUNCTION__,
up->sg_str);
- /* warning only */
- }
+ /* warning only */
+ }
/* detect change in pim_nexthop */
if (nexthop_mismatch(&rpf->source_nexthop, &saved.source_nexthop)) {
diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c
index bebe56567d..d7ebdea45d 100644
--- a/pimd/pim_upstream.c
+++ b/pimd/pim_upstream.c
@@ -577,8 +577,9 @@ pim_upstream_switch(struct pim_upstream *up,
if (old_state == PIM_UPSTREAM_JOINED)
pim_msdp_up_join_state_changed(up);
- /* IHR, Trigger SGRpt on *,G IIF to prune S,G from RPT */
- if (pim_upstream_is_sg_rpt(up) && up->parent)
+ /* IHR, Trigger SGRpt on *,G IIF to prune S,G from RPT towards RP.
+ If I am RP for G then send S,G prune to its IIF. */
+ if (pim_upstream_is_sg_rpt(up) && up->parent && !I_am_RP(up->sg.grp))
{
if (PIM_DEBUG_PIM_TRACE_DETAIL)
zlog_debug ("%s: *,G IIF %s S,G IIF %s ", __PRETTY_FUNCTION__,
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index ecd0b72e78..63a9da57d4 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -2586,6 +2586,7 @@ vtysh_write_config_integrated(void)
err++;
}
+#ifdef FRR_USER
pwentry = getpwnam (FRR_USER);
if (pwentry)
uid = pwentry->pw_uid;
@@ -2594,7 +2595,8 @@ vtysh_write_config_integrated(void)
printf ("%% Warning: could not look up user \"%s\"\n", FRR_USER);
err++;
}
-
+#endif
+#ifdef FRR_GROUP
grentry = getgrnam (FRR_GROUP);
if (grentry)
gid = grentry->gr_gid;
@@ -2603,6 +2605,7 @@ vtysh_write_config_integrated(void)
printf ("%% Warning: could not look up group \"%s\"\n", FRR_GROUP);
err++;
}
+#endif
if (!fstat (fd, &st))
{