diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-01-24 07:48:22 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-01-25 09:15:36 -0500 |
| commit | 8f17f6eb2db11cf8c93c47eda6eafc4981eeab29 (patch) | |
| tree | 7a9af05ea47cc1c819db24eb06775be5f844ef8e /ospf6d | |
| parent | 4912deafad9f5af79adc897e7d80becdbb67926d (diff) | |
ospf6d: use a new json_object per loop iteration
When redistributing multiple route types into ospfv3
the code must create a new array per route type into
the the json code.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'ospf6d')
| -rw-r--r-- | ospf6d/ospf6_asbr.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index af99bc0c88..fdfd53276e 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -1439,8 +1439,7 @@ static void ospf6_redistribute_show_config(struct vty *vty, struct ospf6 *ospf6, struct ospf6_redist *red; total = 0; - for (type = 0; type < ZEBRA_ROUTE_MAX; type++) - nroute[type] = 0; + memset(nroute, 0, sizeof(nroute)); for (route = ospf6_route_head(ospf6->external_table); route; route = ospf6_route_next(route)) { info = route->route_option; @@ -1448,12 +1447,11 @@ static void ospf6_redistribute_show_config(struct vty *vty, struct ospf6 *ospf6, total++; } - if (use_json) - json_route = json_object_new_object(); - else + if (!use_json) vty_out(vty, "Redistributing External Routes from:\n"); for (type = 0; type < ZEBRA_ROUTE_MAX; type++) { + red = ospf6_redist_lookup(ospf6, type, 0); if (!red) @@ -1462,6 +1460,7 @@ static void ospf6_redistribute_show_config(struct vty *vty, struct ospf6 *ospf6, continue; if (use_json) { + json_route = json_object_new_object(); json_object_string_add(json_route, "routeType", ZROUTE_NAME(type)); json_object_int_add(json_route, "numberOfRoutes", |
