summaryrefslogtreecommitdiffstats
path: root/bgpd/rfapi/bgp_rfapi_cfg.c
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2017-07-27 16:05:48 +0200
committerLou Berger <lberger@labn.net>2017-07-27 17:02:31 +0200
commit0ae6124f4807560736ba3ad3b8ce3cb8085e03ce (patch)
treefa67c054f9f3e1ea0dcf96af0e53c5a9624d56be /bgpd/rfapi/bgp_rfapi_cfg.c
parentMerge pull request #842 from qlyoung/update-style-guide (diff)
downloadfrr-0ae6124f4807560736ba3ad3b8ce3cb8085e03ce.tar.xz
frr-0ae6124f4807560736ba3ad3b8ce3cb8085e03ce.zip
bgp rfapi: use route_table_init and _finish (fixes crash due to recent lib change)
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'bgpd/rfapi/bgp_rfapi_cfg.c')
-rw-r--r--bgpd/rfapi/bgp_rfapi_cfg.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c
index 8a93d3984..4b55c20c1 100644
--- a/bgpd/rfapi/bgp_rfapi_cfg.c
+++ b/bgpd/rfapi/bgp_rfapi_cfg.c
@@ -135,10 +135,10 @@ struct rfapi_nve_group_cfg *bgp_rfapi_cfg_match_group(struct rfapi_cfg *hc,
switch (vn->family) {
case AF_INET:
- rt_vn = &(hc->nve_groups_vn[AFI_IP]);
+ rt_vn = hc->nve_groups_vn[AFI_IP];
break;
case AF_INET6:
- rt_vn = &(hc->nve_groups_vn[AFI_IP6]);
+ rt_vn = hc->nve_groups_vn[AFI_IP6];
break;
default:
return NULL;
@@ -146,10 +146,10 @@ struct rfapi_nve_group_cfg *bgp_rfapi_cfg_match_group(struct rfapi_cfg *hc,
switch (un->family) {
case AF_INET:
- rt_un = &(hc->nve_groups_un[AFI_IP]);
+ rt_un = hc->nve_groups_un[AFI_IP];
break;
case AF_INET6:
- rt_un = &(hc->nve_groups_un[AFI_IP6]);
+ rt_un = hc->nve_groups_un[AFI_IP6];
break;
default:
return NULL;
@@ -2527,10 +2527,10 @@ DEFUN (vnc_nve_group_prefix,
}
if (argv[1]->arg[0] == 'u') {
- rt = &(bgp->rfapi_cfg->nve_groups_un[afi]);
+ rt = bgp->rfapi_cfg->nve_groups_un[afi];
is_un_prefix = 1;
} else {
- rt = &(bgp->rfapi_cfg->nve_groups_vn[afi]);
+ rt = bgp->rfapi_cfg->nve_groups_vn[afi];
}
rn = route_node_get(rt, &p); /* NB locks node */
@@ -3838,14 +3838,9 @@ struct rfapi_cfg *bgp_rfapi_cfg_new(struct rfapi_rfp_cfg *cfg)
h->nve_groups_sequential = list_new();
assert(h->nve_groups_sequential);
-
for (afi = AFI_IP; afi < AFI_MAX; afi++) {
- /* ugly, to deal with addition of delegates, part of 0.99.24.1
- * merge */
- h->nve_groups_vn[afi].delegate =
- route_table_get_default_delegate();
- h->nve_groups_un[afi].delegate =
- route_table_get_default_delegate();
+ h->nve_groups_vn[afi] = route_table_init();
+ h->nve_groups_un[afi] = route_table_init();
}
h->default_response_lifetime =
BGP_VNC_DEFAULT_RESPONSE_LIFETIME_DEFAULT;
@@ -3885,6 +3880,7 @@ struct rfapi_cfg *bgp_rfapi_cfg_new(struct rfapi_rfp_cfg *cfg)
void bgp_rfapi_cfg_destroy(struct bgp *bgp, struct rfapi_cfg *h)
{
+ int afi;
if (h == NULL)
return;
@@ -3901,6 +3897,10 @@ void bgp_rfapi_cfg_destroy(struct bgp *bgp, struct rfapi_cfg *h)
ecommunity_free(&h->default_rt_import_list);
if (h->default_rfp_cfg)
XFREE(MTYPE_RFAPI_RFP_GROUP_CFG, h->default_rfp_cfg);
+ for (afi = AFI_IP; afi < AFI_MAX; afi++) {
+ route_table_finish(h->nve_groups_vn[afi]);
+ route_table_finish(h->nve_groups_un[afi]);
+ }
XFREE(MTYPE_RFAPI_CFG, h);
}