summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-05-18 11:37:37 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-05-18 11:37:37 +0200
commit7e467f2d2b3747913d5638c9d101525afa5f460c (patch)
treecd227edca00f47d1113fa46cc01a7a3b4a89f047 /zebra
parentMerge pull request #556 from dslicenc/bgp-fixes (diff)
parentbgpd: Add epoch uptime to BGP neighbor json outputs (diff)
downloadfrr-7e467f2d2b3747913d5638c9d101525afa5f460c.tar.xz
frr-7e467f2d2b3747913d5638c9d101525afa5f460c.zip
Merge branch 'frr/pull/557'
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra')
-rw-r--r--zebra/redistribute.c60
-rw-r--r--zebra/zebra_mpls_vty.c4
2 files changed, 30 insertions, 34 deletions
diff --git a/zebra/redistribute.c b/zebra/redistribute.c
index 9c7ef5f12..5d7dbd5b0 100644
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
@@ -108,42 +108,38 @@ zebra_redistribute_default (struct zserv *client, vrf_id_t vrf_id)
/* Redistribute routes. */
static void
-zebra_redistribute (struct zserv *client, int type, u_short instance, vrf_id_t vrf_id)
+zebra_redistribute (struct zserv *client, int type, u_short instance, vrf_id_t vrf_id, int afi)
{
struct rib *newrib;
struct route_table *table;
struct route_node *rn;
- int afi;
- for (afi = AFI_IP; afi <= AFI_IP6; afi++)
- {
- table = zebra_vrf_table (afi, SAFI_UNICAST, vrf_id);
- if (! table)
- continue;
+ table = zebra_vrf_table (afi, SAFI_UNICAST, vrf_id);
+ if (! table)
+ return;
- for (rn = route_top (table); rn; rn = route_next (rn))
- RNODE_FOREACH_RIB (rn, newrib)
- {
- if (IS_ZEBRA_DEBUG_EVENT)
- zlog_debug("%s: checking: selected=%d, type=%d, distance=%d, "
- "zebra_check_addr=%d", __func__,
- CHECK_FLAG (newrib->flags, ZEBRA_FLAG_SELECTED),
- newrib->type, newrib->distance,
- zebra_check_addr (&rn->p));
-
- if (! CHECK_FLAG (newrib->flags, ZEBRA_FLAG_SELECTED))
- continue;
- if ((type != ZEBRA_ROUTE_ALL &&
- (newrib->type != type || newrib->instance != instance)))
- continue;
- if (newrib->distance == DISTANCE_INFINITY)
- continue;
- if (! zebra_check_addr (&rn->p))
- continue;
-
- zsend_redistribute_route (1, client, &rn->p, newrib);
- }
- }
+ for (rn = route_top (table); rn; rn = route_next (rn))
+ RNODE_FOREACH_RIB (rn, newrib)
+ {
+ if (IS_ZEBRA_DEBUG_EVENT)
+ zlog_debug("%s: checking: selected=%d, type=%d, distance=%d, "
+ "zebra_check_addr=%d", __func__,
+ CHECK_FLAG (newrib->flags, ZEBRA_FLAG_SELECTED),
+ newrib->type, newrib->distance,
+ zebra_check_addr (&rn->p));
+
+ if (! CHECK_FLAG (newrib->flags, ZEBRA_FLAG_SELECTED))
+ continue;
+ if ((type != ZEBRA_ROUTE_ALL &&
+ (newrib->type != type || newrib->instance != instance)))
+ continue;
+ if (newrib->distance == DISTANCE_INFINITY)
+ continue;
+ if (! zebra_check_addr (&rn->p))
+ continue;
+
+ zsend_redistribute_route (1, client, &rn->p, newrib);
+ }
}
/* Either advertise a route for redistribution to registered clients or */
@@ -262,13 +258,13 @@ zebra_redistribute_add (int command, struct zserv *client, int length,
if (! redist_check_instance (&client->mi_redist[afi][type], instance))
{
redist_add_instance (&client->mi_redist[afi][type], instance);
- zebra_redistribute (client, type, instance, zvrf_id (zvrf));
+ zebra_redistribute (client, type, instance, zvrf_id (zvrf), afi);
}
} else {
if (! vrf_bitmap_check (client->redist[afi][type], zvrf_id (zvrf)))
{
vrf_bitmap_set (client->redist[afi][type], zvrf_id (zvrf));
- zebra_redistribute (client, type, 0, zvrf_id (zvrf));
+ zebra_redistribute (client, type, 0, zvrf_id (zvrf), afi);
}
}
}
diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c
index 8b967c3af..343f2975e 100644
--- a/zebra/zebra_mpls_vty.c
+++ b/zebra/zebra_mpls_vty.c
@@ -472,7 +472,7 @@ DEFUN (no_ip_route_tag_distance_label,
DEFUN (no_ip_route_mask_distance_label,
no_ip_route_mask_distance_label_cmd,
- "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255>",
+ "no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) <1-255> label WORD",
NO_STR
IP_STR
"Establish static routes\n"
@@ -486,7 +486,7 @@ DEFUN (no_ip_route_mask_distance_label,
"One or more labels separated by '/'\n")
{
return zebra_static_ipv4 (vty, SAFI_UNICAST, 0, argv[0], argv[1], argv[2], NULL, NULL,
- argv[3], NULL, argv[5]);
+ argv[3], NULL, argv[4]);
}
DEFUN (no_ip_route_mask_tag_distance_label,