summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrgirada <rgirada@vmware.com>2019-02-04 14:27:56 +0100
committerrgirada <rgirada@vmware.com>2019-02-04 14:27:56 +0100
commitb4897fa52474fd49ae3d4ad0bb2ecf908d2630c0 (patch)
tree383f65de1e877fef583fb66015c6738d559e0e43
parentospfd: Added changes to track route-map usage (diff)
downloadfrr-b4897fa52474fd49ae3d4ad0bb2ecf908d2630c0.tar.xz
frr-b4897fa52474fd49ae3d4ad0bb2ecf908d2630c0.zip
bgpd: Added changes to track route-map usage
Made changes and updated the routemap applied counter in the following flows. 1.Increment when route map attached to a list. 2.Decrement when route map removed / modified from a  list. 3.Increment/decrement when route map create/delete callback triggered. 4.Besides ,This counter need not be updated when a route map is got updated. i.e changing/adding a match value to the existing routemap. In BGP , same update api called for all three add/delete/update operation . But this counter have to be updated only for routemap addition. Addressed this specific change by identifying the routemap operation based on routemap pointer. Signed-off-by: RajeshGirada <rgirada@vmware.com>
-rw-r--r--bgpd/bgp_evpn_vty.c4
-rw-r--r--bgpd/bgp_route.c18
-rw-r--r--bgpd/bgp_routemap.c15
-rw-r--r--bgpd/bgp_zebra.c6
-rw-r--r--bgpd/bgpd.c21
-rw-r--r--bgpd/rfapi/bgp_rfapi_cfg.c56
6 files changed, 119 insertions, 1 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index 776f8f8ef..a7da3922b 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -3260,6 +3260,8 @@ DEFUN (bgp_evpn_advertise_type5,
if (bgp_vrf->adv_cmd_rmap[afi][safi].name) {
XFREE(MTYPE_ROUTE_MAP_NAME,
bgp_vrf->adv_cmd_rmap[afi][safi].name);
+ route_map_counter_decrement(
+ bgp_vrf->adv_cmd_rmap[afi][safi].map);
bgp_vrf->adv_cmd_rmap[afi][safi].name = NULL;
bgp_vrf->adv_cmd_rmap[afi][safi].map = NULL;
}
@@ -3271,6 +3273,8 @@ DEFUN (bgp_evpn_advertise_type5,
XSTRDUP(MTYPE_ROUTE_MAP_NAME, argv[idx_rmap + 1]->arg);
bgp_vrf->adv_cmd_rmap[afi][safi].map =
route_map_lookup_by_name(argv[idx_rmap + 1]->arg);
+ route_map_counter_increment(
+ bgp_vrf->adv_cmd_rmap[afi][safi].map);
}
/* advertise type-5 routes */
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 99dc9d812..59ca223a2 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4417,6 +4417,8 @@ static void bgp_static_free(struct bgp_static *bgp_static)
{
if (bgp_static->rmap.name)
XFREE(MTYPE_ROUTE_MAP_NAME, bgp_static->rmap.name);
+ route_map_counter_decrement(bgp_static->rmap.map);
+
if (bgp_static->eth_s_id)
XFREE(MTYPE_ATTR, bgp_static->eth_s_id);
XFREE(MTYPE_BGP_STATIC, bgp_static);
@@ -4981,14 +4983,20 @@ static int bgp_static_set(struct vty *vty, const char *negate,
if (bgp_static->rmap.name)
XFREE(MTYPE_ROUTE_MAP_NAME,
bgp_static->rmap.name);
+ route_map_counter_decrement(
+ bgp_static->rmap.map);
bgp_static->rmap.name =
XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap);
bgp_static->rmap.map =
route_map_lookup_by_name(rmap);
+ route_map_counter_increment(
+ bgp_static->rmap.map);
} else {
if (bgp_static->rmap.name)
XFREE(MTYPE_ROUTE_MAP_NAME,
bgp_static->rmap.name);
+ route_map_counter_decrement(
+ bgp_static->rmap.map);
bgp_static->rmap.name = NULL;
bgp_static->rmap.map = NULL;
bgp_static->valid = 0;
@@ -5007,10 +5015,14 @@ static int bgp_static_set(struct vty *vty, const char *negate,
if (bgp_static->rmap.name)
XFREE(MTYPE_ROUTE_MAP_NAME,
bgp_static->rmap.name);
+ route_map_counter_decrement(
+ bgp_static->rmap.map);
bgp_static->rmap.name =
XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap);
bgp_static->rmap.map =
route_map_lookup_by_name(rmap);
+ route_map_counter_increment(
+ bgp_static->rmap.map);
}
bgp_node_set_bgp_static_info(rn, bgp_static);
}
@@ -5289,10 +5301,12 @@ int bgp_static_set_safi(afi_t afi, safi_t safi, struct vty *vty,
if (bgp_static->rmap.name)
XFREE(MTYPE_ROUTE_MAP_NAME,
bgp_static->rmap.name);
+ route_map_counter_decrement(bgp_static->rmap.map);
bgp_static->rmap.name =
XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap_str);
bgp_static->rmap.map =
route_map_lookup_by_name(rmap_str);
+ route_map_counter_increment(bgp_static->rmap.map);
}
if (safi == SAFI_EVPN) {
@@ -5395,11 +5409,14 @@ static int bgp_table_map_set(struct vty *vty, afi_t afi, safi_t safi,
if (rmap_name) {
if (rmap->name)
XFREE(MTYPE_ROUTE_MAP_NAME, rmap->name);
+ route_map_counter_decrement(rmap->map);
rmap->name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap_name);
rmap->map = route_map_lookup_by_name(rmap_name);
+ route_map_counter_increment(rmap->map);
} else {
if (rmap->name)
XFREE(MTYPE_ROUTE_MAP_NAME, rmap->name);
+ route_map_counter_decrement(rmap->map);
rmap->name = NULL;
rmap->map = NULL;
}
@@ -5419,6 +5436,7 @@ static int bgp_table_map_unset(struct vty *vty, afi_t afi, safi_t safi,
rmap = &bgp->table_map[afi][safi];
if (rmap->name)
XFREE(MTYPE_ROUTE_MAP_NAME, rmap->name);
+ route_map_counter_decrement(rmap->map);
rmap->name = NULL;
rmap->map = NULL;
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index 4953032f9..e28acdfba 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -3250,6 +3250,15 @@ static void bgp_route_map_process_update(struct bgp *bgp, const char *rmap_name,
if (bgp->table_map[afi][safi].name
&& (strcmp(rmap_name, bgp->table_map[afi][safi].name)
== 0)) {
+
+ /* bgp->table_map[afi][safi].map is NULL.
+ * i.e Route map creation event.
+ * So update applied_counter.
+ * If it is not NULL, i.e It may be routemap updation or
+ * deletion. so no need to update the counter.
+ */
+ if (!bgp->table_map[afi][safi].map)
+ route_map_counter_increment(map);
bgp->table_map[afi][safi].map = map;
if (BGP_DEBUG(zebra, ZEBRA))
@@ -3272,6 +3281,9 @@ static void bgp_route_map_process_update(struct bgp *bgp, const char *rmap_name,
|| (strcmp(rmap_name, bgp_static->rmap.name) != 0))
continue;
+ if (!bgp_static->rmap.map)
+ route_map_counter_increment(map);
+
bgp_static->rmap.map = map;
if (route_update && !bgp_static->backdoor) {
@@ -3303,6 +3315,9 @@ static void bgp_route_map_process_update(struct bgp *bgp, const char *rmap_name,
|| (strcmp(rmap_name, red->rmap.name) != 0))
continue;
+ if (!red->rmap.map)
+ route_map_counter_increment(map);
+
red->rmap.map = map;
if (!route_update)
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 75da03882..a477c3d34 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1683,8 +1683,13 @@ int bgp_redistribute_rmap_set(struct bgp_redist *red, const char *name,
if (red->rmap.name)
XFREE(MTYPE_ROUTE_MAP_NAME, red->rmap.name);
+ /* Decrement the count for existing routemap and
+ * increment the count for new route map.
+ */
+ route_map_counter_decrement(red->rmap.map);
red->rmap.name = XSTRDUP(MTYPE_ROUTE_MAP_NAME, name);
red->rmap.map = route_map;
+ route_map_counter_increment(red->rmap.map);
return 1;
}
@@ -1792,6 +1797,7 @@ int bgp_redistribute_unset(struct bgp *bgp, afi_t afi, int type,
/* Unset route-map. */
if (red->rmap.name)
XFREE(MTYPE_ROUTE_MAP_NAME, red->rmap.name);
+ route_map_counter_decrement(red->rmap.map);
red->rmap.name = NULL;
red->rmap.map = NULL;
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index 0ab9a0b92..aceb99053 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -4594,15 +4594,18 @@ int peer_default_originate_set(struct peer *peer, afi_t afi, safi_t safi,
XFREE(MTYPE_ROUTE_MAP_NAME,
peer->default_rmap[afi][safi].name);
+ route_map_counter_decrement(peer->default_rmap[afi][safi].map);
peer->default_rmap[afi][safi].name =
XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap);
peer->default_rmap[afi][safi].map = route_map;
+ route_map_counter_increment(route_map);
}
} else if (!rmap) {
if (peer->default_rmap[afi][safi].name)
XFREE(MTYPE_ROUTE_MAP_NAME,
peer->default_rmap[afi][safi].name);
+ route_map_counter_decrement(peer->default_rmap[afi][safi].map);
peer->default_rmap[afi][safi].name = NULL;
peer->default_rmap[afi][safi].map = NULL;
}
@@ -4637,10 +4640,12 @@ int peer_default_originate_set(struct peer *peer, afi_t afi, safi_t safi,
if (member->default_rmap[afi][safi].name)
XFREE(MTYPE_ROUTE_MAP_NAME,
member->default_rmap[afi][safi].name);
-
+ route_map_counter_decrement(
+ member->default_rmap[afi][safi].map);
member->default_rmap[afi][safi].name =
XSTRDUP(MTYPE_ROUTE_MAP_NAME, rmap);
member->default_rmap[afi][safi].map = route_map;
+ route_map_counter_increment(route_map);
}
/* Update peer route announcements. */
@@ -4677,6 +4682,7 @@ int peer_default_originate_unset(struct peer *peer, afi_t afi, safi_t safi)
if (peer->default_rmap[afi][safi].name)
XFREE(MTYPE_ROUTE_MAP_NAME,
peer->default_rmap[afi][safi].name);
+ route_map_counter_decrement(peer->default_rmap[afi][safi].map);
peer->default_rmap[afi][safi].name = NULL;
peer->default_rmap[afi][safi].map = NULL;
}
@@ -4710,6 +4716,7 @@ int peer_default_originate_unset(struct peer *peer, afi_t afi, safi_t safi)
if (peer->default_rmap[afi][safi].name)
XFREE(MTYPE_ROUTE_MAP_NAME,
peer->default_rmap[afi][safi].name);
+ route_map_counter_decrement(peer->default_rmap[afi][safi].map);
peer->default_rmap[afi][safi].name = NULL;
peer->default_rmap[afi][safi].map = NULL;
@@ -6118,8 +6125,10 @@ int peer_route_map_set(struct peer *peer, afi_t afi, safi_t safi, int direct,
filter = &peer->filter[afi][safi];
if (filter->map[direct].name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->map[direct].name);
+ route_map_counter_decrement(filter->map[direct].map);
filter->map[direct].name = XSTRDUP(MTYPE_BGP_FILTER_NAME, name);
filter->map[direct].map = route_map;
+ route_map_counter_increment(route_map);
/* Check if handling a regular peer. */
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
@@ -6147,8 +6156,10 @@ int peer_route_map_set(struct peer *peer, afi_t afi, safi_t safi, int direct,
filter = &member->filter[afi][safi];
if (filter->map[direct].name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->map[direct].name);
+ route_map_counter_decrement(filter->map[direct].map);
filter->map[direct].name = XSTRDUP(MTYPE_BGP_FILTER_NAME, name);
filter->map[direct].map = route_map;
+ route_map_counter_increment(route_map);
/* Process peer route updates. */
peer_on_policy_change(member, afi, safi,
@@ -6182,6 +6193,7 @@ int peer_route_map_unset(struct peer *peer, afi_t afi, safi_t safi, int direct)
filter = &peer->filter[afi][safi];
if (filter->map[direct].name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->map[direct].name);
+ route_map_counter_decrement(filter->map[direct].map);
filter->map[direct].name = NULL;
filter->map[direct].map = NULL;
}
@@ -6210,6 +6222,7 @@ int peer_route_map_unset(struct peer *peer, afi_t afi, safi_t safi, int direct)
filter = &member->filter[afi][safi];
if (filter->map[direct].name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->map[direct].name);
+ route_map_counter_decrement(filter->map[direct].map);
filter->map[direct].name = NULL;
filter->map[direct].map = NULL;
@@ -6233,8 +6246,10 @@ int peer_unsuppress_map_set(struct peer *peer, afi_t afi, safi_t safi,
filter = &peer->filter[afi][safi];
if (filter->usmap.name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->usmap.name);
+ route_map_counter_decrement(filter->usmap.map);
filter->usmap.name = XSTRDUP(MTYPE_BGP_FILTER_NAME, name);
filter->usmap.map = route_map;
+ route_map_counter_increment(route_map);
/* Check if handling a regular peer. */
if (!CHECK_FLAG(peer->sflags, PEER_STATUS_GROUP)) {
@@ -6261,8 +6276,10 @@ int peer_unsuppress_map_set(struct peer *peer, afi_t afi, safi_t safi,
filter = &member->filter[afi][safi];
if (filter->usmap.name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->usmap.name);
+ route_map_counter_decrement(filter->usmap.map);
filter->usmap.name = XSTRDUP(MTYPE_BGP_FILTER_NAME, name);
filter->usmap.map = route_map;
+ route_map_counter_increment(route_map);
/* Process peer route updates. */
peer_on_policy_change(member, afi, safi, 1);
@@ -6293,6 +6310,7 @@ int peer_unsuppress_map_unset(struct peer *peer, afi_t afi, safi_t safi)
filter = &peer->filter[afi][safi];
if (filter->usmap.name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->usmap.name);
+ route_map_counter_decrement(filter->usmap.map);
filter->usmap.name = NULL;
filter->usmap.map = NULL;
}
@@ -6320,6 +6338,7 @@ int peer_unsuppress_map_unset(struct peer *peer, afi_t afi, safi_t safi)
filter = &member->filter[afi][safi];
if (filter->usmap.name)
XFREE(MTYPE_BGP_FILTER_NAME, filter->usmap.name);
+ route_map_counter_decrement(filter->usmap.map);
filter->usmap.name = NULL;
filter->usmap.map = NULL;
diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c
index 05e057f07..13713c11f 100644
--- a/bgpd/rfapi/bgp_rfapi_cfg.c
+++ b/bgpd/rfapi/bgp_rfapi_cfg.c
@@ -1164,9 +1164,16 @@ DEFUN (vnc_redist_bgpdirect_routemap,
if (hc->routemap_redist_name[route_type])
free(hc->routemap_redist_name[route_type]);
+
+ /* If the old route map config overwrite with new
+ * route map config , old routemap counter have to be
+ * reduced.
+ */
+ route_map_counter_decrement(hc->routemap_redist[route_type]);
hc->routemap_redist_name[route_type] = strdup(argv[4]->arg);
hc->routemap_redist[route_type] =
route_map_lookup_by_name(argv[4]->arg);
+ route_map_counter_increment(hc->routemap_redist[route_type]);
vnc_redistribute_postchange(bgp);
@@ -1210,6 +1217,8 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist,
if (rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi])
free(rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi]);
+ route_map_counter_decrement(
+ rfg->plist_redist[ZEBRA_ROUTE_BGP_DIRECT][afi]);
rfg->plist_redist_name[ZEBRA_ROUTE_BGP_DIRECT][afi] = NULL;
rfg->plist_redist[ZEBRA_ROUTE_BGP_DIRECT][afi] = NULL;
@@ -1285,6 +1294,8 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap,
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
free(rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
+ route_map_counter_decrement(
+ rfg->routemap_redist[ZEBRA_ROUTE_BGP_DIRECT]);
rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT] = NULL;
rfg->routemap_redist[ZEBRA_ROUTE_BGP_DIRECT] = NULL;
@@ -1316,10 +1327,14 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap,
if (rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT])
free(rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT]);
+ route_map_counter_decrement(
+ rfg->routemap_redist[ZEBRA_ROUTE_BGP_DIRECT]);
rfg->routemap_redist_name[ZEBRA_ROUTE_BGP_DIRECT] =
strdup(argv[3]->arg);
rfg->routemap_redist[ZEBRA_ROUTE_BGP_DIRECT] =
route_map_lookup_by_name(argv[3]->arg);
+ route_map_counter_increment(
+ rfg->routemap_redist[ZEBRA_ROUTE_BGP_DIRECT]);
vnc_redistribute_postchange(bgp);
@@ -1741,6 +1756,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
rfg->routemap_export_bgp_name))) {
if (rfg->routemap_export_bgp_name)
free(rfg->routemap_export_bgp_name);
+ route_map_counter_decrement(rfg->routemap_export_bgp);
rfg->routemap_export_bgp_name = NULL;
rfg->routemap_export_bgp = NULL;
@@ -1754,6 +1770,7 @@ DEFUN (vnc_nve_group_export_no_routemap,
rfg->routemap_export_zebra_name))) {
if (rfg->routemap_export_zebra_name)
free(rfg->routemap_export_zebra_name);
+ route_map_counter_decrement(rfg->routemap_export_zebra);
rfg->routemap_export_zebra_name = NULL;
rfg->routemap_export_zebra = NULL;
@@ -1800,17 +1817,21 @@ DEFUN (vnc_nve_group_export_routemap,
if (is_bgp) {
if (rfg->routemap_export_bgp_name)
free(rfg->routemap_export_bgp_name);
+ route_map_counter_decrement(rfg->routemap_export_bgp);
rfg->routemap_export_bgp_name = strdup(argv[idx]->arg);
rfg->routemap_export_bgp =
route_map_lookup_by_name(argv[idx]->arg);
+ route_map_counter_increment(rfg->routemap_export_bgp);
vnc_direct_bgp_reexport_group_afi(bgp, rfg, AFI_IP);
vnc_direct_bgp_reexport_group_afi(bgp, rfg, AFI_IP6);
} else {
if (rfg->routemap_export_zebra_name)
free(rfg->routemap_export_zebra_name);
+ route_map_counter_decrement(rfg->routemap_export_zebra);
rfg->routemap_export_zebra_name = strdup(argv[idx]->arg);
rfg->routemap_export_zebra =
route_map_lookup_by_name(argv[idx]->arg);
+ route_map_counter_increment(rfg->routemap_export_zebra);
vnc_zebra_reexport_group_afi(bgp, rfg, AFI_IP);
vnc_zebra_reexport_group_afi(bgp, rfg, AFI_IP6);
}
@@ -1937,6 +1958,7 @@ DEFUN (vnc_nve_export_no_routemap,
|| (argc <= 5)) {
free(hc->routemap_export_bgp_name);
+ route_map_counter_decrement(hc->routemap_export_bgp);
hc->routemap_export_bgp_name = NULL;
hc->routemap_export_bgp = NULL;
vnc_direct_bgp_reexport(bgp, AFI_IP);
@@ -1948,6 +1970,7 @@ DEFUN (vnc_nve_export_no_routemap,
|| (argc <= 5)) {
free(hc->routemap_export_zebra_name);
+ route_map_counter_decrement(hc->routemap_export_zebra);
hc->routemap_export_zebra_name = NULL;
hc->routemap_export_zebra = NULL;
/* TBD vnc_zebra_rh_reexport(bgp, AFI_IP); */
@@ -1975,17 +1998,21 @@ DEFUN (vnc_nve_export_routemap,
if (argv[2]->arg[0] == 'b') {
if (hc->routemap_export_bgp_name)
free(hc->routemap_export_bgp_name);
+ route_map_counter_decrement(hc->routemap_export_bgp);
hc->routemap_export_bgp_name = strdup(argv[4]->arg);
hc->routemap_export_bgp =
route_map_lookup_by_name(argv[4]->arg);
+ route_map_counter_increment(hc->routemap_export_bgp);
vnc_direct_bgp_reexport(bgp, AFI_IP);
vnc_direct_bgp_reexport(bgp, AFI_IP6);
} else {
if (hc->routemap_export_zebra_name)
free(hc->routemap_export_zebra_name);
+ route_map_counter_decrement(hc->routemap_export_zebra);
hc->routemap_export_zebra_name = strdup(argv[4]->arg);
hc->routemap_export_zebra =
route_map_lookup_by_name(argv[4]->arg);
+ route_map_counter_increment(hc->routemap_export_zebra);
/* TBD vnc_zebra_rh_reexport(bgp, AFI_IP); */
/* TBD vnc_zebra_rh_reexport(bgp, AFI_IP6); */
}
@@ -2083,6 +2110,7 @@ void vnc_routemap_update(struct bgp *bgp, const char *unused)
struct rfapi_nve_group_cfg *rfg;
struct rfapi_cfg *hc;
int i;
+ struct route_map *old = NULL;
vnc_zlog_debug_verbose("%s(arg=%s)", __func__, unused);
@@ -2104,18 +2132,36 @@ void vnc_routemap_update(struct bgp *bgp, const char *unused)
rfg)) {
if (rfg->routemap_export_bgp_name) {
+ old = rfg->routemap_export_bgp;
rfg->routemap_export_bgp = route_map_lookup_by_name(
rfg->routemap_export_bgp_name);
+ /* old is NULL. i.e Route map creation event.
+ * So update applied_counter.
+ * If Old is not NULL, i.e It may be routemap
+ * updation or deletion.
+ * So no need to update the counter.
+ */
+ if (!old)
+ route_map_counter_increment(
+ rfg->routemap_export_bgp);
}
if (rfg->routemap_export_zebra_name) {
+ old = rfg->routemap_export_bgp;
rfg->routemap_export_bgp = route_map_lookup_by_name(
rfg->routemap_export_zebra_name);
+ if (!old)
+ route_map_counter_increment(
+ rfg->routemap_export_bgp);
}
for (i = 0; i < ZEBRA_ROUTE_MAX; ++i) {
if (rfg->routemap_redist_name[i]) {
+ old = rfg->routemap_redist[i];
rfg->routemap_redist[i] =
route_map_lookup_by_name(
rfg->routemap_redist_name[i]);
+ if (!old)
+ route_map_counter_increment(
+ rfg->routemap_redist[i]);
}
}
@@ -2128,17 +2174,27 @@ void vnc_routemap_update(struct bgp *bgp, const char *unused)
* RH config, too
*/
if (hc->routemap_export_bgp_name) {
+ old = hc->routemap_export_bgp;
hc->routemap_export_bgp =
route_map_lookup_by_name(hc->routemap_export_bgp_name);
+ if (!old)
+ route_map_counter_increment(hc->routemap_export_bgp);
}
if (hc->routemap_export_zebra_name) {
+ old = hc->routemap_export_bgp;
hc->routemap_export_bgp = route_map_lookup_by_name(
hc->routemap_export_zebra_name);
+ if (!old)
+ route_map_counter_increment(hc->routemap_export_bgp);
}
for (i = 0; i < ZEBRA_ROUTE_MAX; ++i) {
if (hc->routemap_redist_name[i]) {
+ old = hc->routemap_redist[i];
hc->routemap_redist[i] = route_map_lookup_by_name(
hc->routemap_redist_name[i]);
+ if (!old)
+ route_map_counter_increment(
+ hc->routemap_redist[i]);
}
}