summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zebra/rib.h1
-rw-r--r--zebra/zebra_fpm_netlink.c5
-rw-r--r--zebra/zebra_mpls.c6
-rw-r--r--zebra/zebra_router.c1
4 files changed, 8 insertions, 5 deletions
diff --git a/zebra/rib.h b/zebra/rib.h
index 6ec9241b73..b9f4e56905 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -300,6 +300,7 @@ struct rib_table_info {
struct zebra_vrf *zvrf;
afi_t afi;
safi_t safi;
+ uint32_t table_id;
};
enum rib_tables_iter_state {
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index 5831093b50..3e11d53b16 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -279,7 +279,6 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd,
rib_dest_t *dest, struct route_entry *re)
{
struct nexthop *nexthop;
- struct zebra_vrf *zvrf;
memset(ri, 0, sizeof(*ri));
@@ -287,9 +286,7 @@ static int netlink_route_info_fill(struct netlink_route_info *ri, int cmd,
ri->af = rib_dest_af(dest);
ri->nlmsg_type = cmd;
- zvrf = rib_dest_vrf(dest);
- if (zvrf)
- ri->rtm_table = zvrf->table_id;
+ ri->rtm_table = rib_table_info(rib_dest_table(dest))->table_id;
ri->rtm_protocol = RTPROT_UNSPEC;
/*
diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c
index f905036323..1ac7bc7a2a 100644
--- a/zebra/zebra_mpls.c
+++ b/zebra/zebra_mpls.c
@@ -3321,7 +3321,7 @@ lsp_add_nhlfe(zebra_lsp_t *lsp, enum lsp_types_t type,
/*
* Install an LSP and forwarding entry; used primarily
- * from zapi message processing.
+ * from vrf zapi message processing.
*/
int mpls_lsp_install(struct zebra_vrf *zvrf, enum lsp_types_t type,
mpls_label_t in_label, uint8_t num_out_labels,
@@ -3381,6 +3381,10 @@ static int lsp_znh_install(zebra_lsp_t *lsp, enum lsp_types_t type,
memcpy(nhlfe->nexthop->backup_idx, znh->backup_idx,
znh->backup_num);
SET_FLAG(nhlfe->nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP);
+ } else {
+ /* Ensure there's no stale backup info */
+ UNSET_FLAG(nhlfe->nexthop->flags, NEXTHOP_FLAG_HAS_BACKUP);
+ nhlfe->nexthop->backup_num = 0;
}
/* Queue LSP for processing. */
diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c
index 61fef8779f..66f2924555 100644
--- a/zebra/zebra_router.c
+++ b/zebra/zebra_router.c
@@ -133,6 +133,7 @@ struct route_table *zebra_router_get_table(struct zebra_vrf *zvrf,
info->zvrf = zvrf;
info->afi = afi;
info->safi = safi;
+ info->table_id = tableid;
route_table_set_info(zrt->table, info);
zrt->table->cleanup = zebra_rtable_node_cleanup;