summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_top.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_top.c')
-rw-r--r--ospf6d/ospf6_top.c36
1 files changed, 9 insertions, 27 deletions
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 6fe7055202..6bff52fc56 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -423,7 +423,6 @@ static struct ospf6 *ospf6_create(const char *name)
* 1::1, this happened because of LS ID 0.
*/
o->external_id = OSPF6_EXT_INIT_LS_ID;
- o->external_id_table = route_table_init();
o->write_oi_count = OSPF6_WRITE_INTERFACE_COUNT_DEFAULT;
o->ref_bandwidth = OSPF6_REFERENCE_BANDWIDTH;
@@ -432,7 +431,6 @@ static struct ospf6 *ospf6_create(const char *name)
o->rt_aggr_tbl = route_table_init();
o->aggr_delay_interval = OSPF6_EXTL_AGGR_DEFAULT_DELAY;
- o->t_external_aggr = NULL;
o->aggr_action = OSPF6_ROUTE_AGGR_NONE;
o->fd = -1;
@@ -516,7 +514,6 @@ void ospf6_delete(struct ospf6 *o)
ospf6_route_table_delete(o->brouter_table);
ospf6_route_table_delete(o->external_table);
- route_table_finish(o->external_id_table);
ospf6_distance_reset(o);
route_table_finish(o->distance_table);
@@ -563,6 +560,8 @@ static void ospf6_disable(struct ospf6 *o)
THREAD_OFF(o->t_ospf6_receive);
THREAD_OFF(o->t_external_aggr);
THREAD_OFF(o->gr_info.t_grace_period);
+ THREAD_OFF(o->t_write);
+ THREAD_OFF(o->t_abr_task);
}
}
@@ -584,8 +583,6 @@ static int ospf6_maxage_remover(struct thread *thread)
struct listnode *i, *j, *k;
int reschedule = 0;
- o->maxage_remover = (struct thread *)NULL;
-
for (ALL_LIST_ELEMENTS_RO(o->area_list, i, oa)) {
for (ALL_LIST_ELEMENTS_RO(oa->if_list, j, oi)) {
for (ALL_LIST_ELEMENTS_RO(oi->neighbor_list, k, on)) {
@@ -1033,7 +1030,6 @@ DEFUN_HIDDEN (ospf6_interface_area,
struct ospf6_area *oa;
struct ospf6_interface *oi;
struct interface *ifp;
- vrf_id_t vrf_id = VRF_DEFAULT;
uint32_t area_id;
int format;
@@ -1042,11 +1038,8 @@ DEFUN_HIDDEN (ospf6_interface_area,
vty_out(vty,
"Please, use \"ipv6 ospf6 area\" on an interface instead.\n");
- if (ospf6->vrf_id != VRF_UNKNOWN)
- vrf_id = ospf6->vrf_id;
-
/* find/create ospf6 interface */
- ifp = if_get_by_name(argv[idx_ifname]->arg, vrf_id);
+ ifp = if_get_by_name(argv[idx_ifname]->arg, ospf6->vrf_id, ospf6->name);
oi = (struct ospf6_interface *)ifp->info;
if (oi == NULL)
oi = ospf6_interface_create(ifp);
@@ -1108,18 +1101,14 @@ DEFUN_HIDDEN (no_ospf6_interface_area,
struct ospf6_area *oa;
struct interface *ifp;
uint32_t area_id;
- vrf_id_t vrf_id = VRF_DEFAULT;
vty_out(vty,
"This command is deprecated, because it is not VRF-aware.\n");
vty_out(vty,
"Please, use \"no ipv6 ospf6 area\" on an interface instead.\n");
- if (ospf6->vrf_id != VRF_UNKNOWN)
- vrf_id = ospf6->vrf_id;
-
/* find/create ospf6 interface */
- ifp = if_get_by_name(argv[idx_ifname]->arg, vrf_id);
+ ifp = if_get_by_name(argv[idx_ifname]->arg, ospf6->vrf_id, ospf6->name);
if (ifp == NULL) {
vty_out(vty, "No such interface %s\n", argv[idx_ifname]->arg);
@@ -1491,9 +1480,8 @@ DEFUN(show_ipv6_ospf6_vrfs, show_ipv6_ospf6_vrfs_cmd,
if (uj) {
json_object_int_add(json_vrf, "vrfId", vrf_id_ui);
- json_object_string_add(json_vrf, "routerId",
- inet_ntop(AF_INET, &router_id,
- buf, sizeof(buf)));
+ json_object_string_addf(json_vrf, "routerId", "%pI4",
+ &router_id);
json_object_object_add(json_vrfs, name, json_vrf);
} else {
@@ -1508,10 +1496,7 @@ DEFUN(show_ipv6_ospf6_vrfs, show_ipv6_ospf6_vrfs_cmd,
json_object_object_add(json, "vrfs", json_vrfs);
json_object_int_add(json, "totalVrfs", count);
- vty_out(vty, "%s\n",
- json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
} else {
if (count)
vty_out(vty, "\nTotal number of OSPF VRFs: %d\n",
@@ -2103,9 +2088,7 @@ DEFPY (show_ipv6_ospf6_external_aggregator,
}
if (uj) {
- vty_out(vty, "%s\n", json_object_to_json_string_ext(
- json, JSON_C_TO_STRING_PRETTY));
- json_object_free(json);
+ vty_json(vty, json);
}
return CMD_SUCCESS;
@@ -2113,9 +2096,8 @@ DEFPY (show_ipv6_ospf6_external_aggregator,
static void ospf6_stub_router_config_write(struct vty *vty, struct ospf6 *ospf6)
{
- if (CHECK_FLAG(ospf6->flag, OSPF6_STUB_ROUTER)) {
+ if (CHECK_FLAG(ospf6->flag, OSPF6_STUB_ROUTER))
vty_out(vty, " stub-router administrative\n");
- }
return;
}