summaryrefslogtreecommitdiff
path: root/ospf6d
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_abr.c24
-rw-r--r--ospf6d/ospf6_asbr.c6
-rw-r--r--ospf6d/ospf6_intra.c8
-rw-r--r--ospf6d/ospf6_lsa.c10
-rw-r--r--ospf6d/ospf6_lsa.h4
-rw-r--r--ospf6d/ospf6_spf.c6
-rw-r--r--ospf6d/ospf6_top.c4
-rw-r--r--ospf6d/ospf6_zebra.c6
8 files changed, 41 insertions, 27 deletions
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index ead186b6fc..1f6cc9d527 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -1200,9 +1200,23 @@ void ospf6_abr_examin_summary(struct ospf6_lsa *lsa, struct ospf6_area *oa)
listcount(old_route->nh_list));
}
} else {
- /* adv. router exists in the list, update the nhs */
- list_delete_all_node(o_path->nh_list);
- ospf6_copy_nexthops(o_path->nh_list, route->nh_list);
+ struct ospf6_route *tmp_route = ospf6_route_create();
+
+ ospf6_copy_nexthops(tmp_route->nh_list,
+ o_path->nh_list);
+
+ if (ospf6_route_cmp_nexthops(tmp_route, route) != 0) {
+ /* adv. router exists in the list, update nhs */
+ list_delete_all_node(o_path->nh_list);
+ ospf6_copy_nexthops(o_path->nh_list,
+ route->nh_list);
+ ospf6_route_delete(tmp_route);
+ } else {
+ /* adv. router has no change in nhs */
+ old_entry_updated = false;
+ ospf6_route_delete(tmp_route);
+ continue;
+ }
}
if (is_debug)
@@ -1427,7 +1441,7 @@ void install_element_ospf6_debug_abr(void)
install_element(CONFIG_NODE, &no_debug_ospf6_abr_cmd);
}
-static const struct ospf6_lsa_handler inter_prefix_handler = {
+static struct ospf6_lsa_handler inter_prefix_handler = {
.lh_type = OSPF6_LSTYPE_INTER_PREFIX,
.lh_name = "Inter-Prefix",
.lh_short_name = "IAP",
@@ -1435,7 +1449,7 @@ static const struct ospf6_lsa_handler inter_prefix_handler = {
.lh_get_prefix_str = ospf6_inter_area_prefix_lsa_get_prefix_str,
.lh_debug = 0};
-static const struct ospf6_lsa_handler inter_router_handler = {
+static struct ospf6_lsa_handler inter_router_handler = {
.lh_type = OSPF6_LSTYPE_INTER_ROUTER,
.lh_name = "Inter-Router",
.lh_short_name = "IAR",
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 805e411c7b..6e71a21bd5 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -918,8 +918,8 @@ void ospf6_asbr_distribute_list_update(int type)
ZROUTE_NAME(type));
ospf6->t_distribute_update = NULL;
- thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer,
- (void **)args, OSPF_MIN_LS_INTERVAL,
+ thread_add_timer_msec(master, ospf6_asbr_routemap_update_timer, args,
+ OSPF_MIN_LS_INTERVAL,
&ospf6->t_distribute_update);
}
@@ -1853,7 +1853,7 @@ DEFUN (show_ipv6_ospf6_redistribute,
return CMD_SUCCESS;
}
-static const struct ospf6_lsa_handler as_external_handler = {
+static struct ospf6_lsa_handler as_external_handler = {
.lh_type = OSPF6_LSTYPE_AS_EXTERNAL,
.lh_name = "AS-External",
.lh_short_name = "ASE",
diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c
index 9c239b75ff..b700899ccf 100644
--- a/ospf6d/ospf6_intra.c
+++ b/ospf6d/ospf6_intra.c
@@ -2235,7 +2235,7 @@ void ospf6_intra_brouter_calculation(struct ospf6_area *oa)
__func__, oa->name);
}
-static const struct ospf6_lsa_handler router_handler = {
+static struct ospf6_lsa_handler router_handler = {
.lh_type = OSPF6_LSTYPE_ROUTER,
.lh_name = "Router",
.lh_short_name = "Rtr",
@@ -2243,7 +2243,7 @@ static const struct ospf6_lsa_handler router_handler = {
.lh_get_prefix_str = ospf6_router_lsa_get_nbr_id,
.lh_debug = 0};
-static const struct ospf6_lsa_handler network_handler = {
+static struct ospf6_lsa_handler network_handler = {
.lh_type = OSPF6_LSTYPE_NETWORK,
.lh_name = "Network",
.lh_short_name = "Net",
@@ -2251,7 +2251,7 @@ static const struct ospf6_lsa_handler network_handler = {
.lh_get_prefix_str = ospf6_network_lsa_get_ar_id,
.lh_debug = 0};
-static const struct ospf6_lsa_handler link_handler = {
+static struct ospf6_lsa_handler link_handler = {
.lh_type = OSPF6_LSTYPE_LINK,
.lh_name = "Link",
.lh_short_name = "Lnk",
@@ -2259,7 +2259,7 @@ static const struct ospf6_lsa_handler link_handler = {
.lh_get_prefix_str = ospf6_link_lsa_get_prefix_str,
.lh_debug = 0};
-static const struct ospf6_lsa_handler intra_prefix_handler = {
+static struct ospf6_lsa_handler intra_prefix_handler = {
.lh_type = OSPF6_LSTYPE_INTRA_PREFIX,
.lh_name = "Intra-Prefix",
.lh_short_name = "INP",
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 9acbd09b1a..bcfd975879 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -77,16 +77,16 @@ static struct ospf6_lsa_handler unknown_handler = {
.lh_debug = 0 /* No default debug */
};
-void ospf6_install_lsa_handler(const struct ospf6_lsa_handler *handler)
+void ospf6_install_lsa_handler(struct ospf6_lsa_handler *handler)
{
/* type in handler is host byte order */
int index = handler->lh_type & OSPF6_LSTYPE_FCODE_MASK;
vector_set_index(ospf6_lsa_handler_vector, index, (void *)handler);
}
-const struct ospf6_lsa_handler *ospf6_get_lsa_handler(uint16_t type)
+struct ospf6_lsa_handler *ospf6_get_lsa_handler(uint16_t type)
{
- const struct ospf6_lsa_handler *handler = NULL;
+ struct ospf6_lsa_handler *handler = NULL;
unsigned int index = ntohs(type) & OSPF6_LSTYPE_FCODE_MASK;
if (index >= vector_active(ospf6_lsa_handler_vector))
@@ -527,7 +527,7 @@ struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header)
/* allocate memory */
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
- lsa->header = (struct ospf6_lsa_header *)new_header;
+ lsa->header = new_header;
/* dump string */
ospf6_lsa_printbuf(lsa, lsa->name, sizeof(lsa->name));
@@ -554,7 +554,7 @@ struct ospf6_lsa *ospf6_lsa_create_headeronly(struct ospf6_lsa_header *header)
/* allocate memory */
lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
- lsa->header = (struct ospf6_lsa_header *)new_header;
+ lsa->header = new_header;
SET_FLAG(lsa->flag, OSPF6_LSA_HEADERONLY);
/* dump string */
diff --git a/ospf6d/ospf6_lsa.h b/ospf6d/ospf6_lsa.h
index d871a8842e..02f9f9d26c 100644
--- a/ospf6d/ospf6_lsa.h
+++ b/ospf6d/ospf6_lsa.h
@@ -237,8 +237,8 @@ extern int ospf6_lsa_checksum_valid(struct ospf6_lsa_header *);
extern int ospf6_lsa_prohibited_duration(uint16_t type, uint32_t id,
uint32_t adv_router, void *scope);
-extern void ospf6_install_lsa_handler(const struct ospf6_lsa_handler *handler);
-extern const struct ospf6_lsa_handler *ospf6_get_lsa_handler(uint16_t type);
+extern void ospf6_install_lsa_handler(struct ospf6_lsa_handler *handler);
+extern struct ospf6_lsa_handler *ospf6_get_lsa_handler(uint16_t type);
extern void ospf6_lsa_init(void);
extern void ospf6_lsa_terminate(void);
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index b0fe890d33..80bff5795f 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -989,7 +989,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
rtr_lsa = ospf6_lsdb_next(end, rtr_lsa);
continue;
}
- lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
+ lsa_header = rtr_lsa->header;
total_lsa_length += (ntohs(lsa_header->length) - lsa_length);
num_lsa++;
rtr_lsa = ospf6_lsdb_next(end, rtr_lsa);
@@ -1027,7 +1027,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
assert(rtr_lsa);
if (!OSPF6_LSA_IS_MAXAGE(rtr_lsa)) {
/* Append first Link State ID LSA */
- lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
+ lsa_header = rtr_lsa->header;
memcpy(new_header, lsa_header, ntohs(lsa_header->length));
/* Assign new lsa length as aggregated length. */
((struct ospf6_lsa_header *)new_header)->length =
@@ -1057,7 +1057,7 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
}
/* Append Next Link State ID LSA */
- lsa_header = (struct ospf6_lsa_header *)rtr_lsa->header;
+ lsa_header = rtr_lsa->header;
memcpy(new_header, (OSPF6_LSA_HEADER_END(rtr_lsa->header) + 4),
(ntohs(lsa_header->length) - lsa_length));
new_header += (ntohs(lsa_header->length) - lsa_length);
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 96eee51929..dc10fa52cb 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -52,8 +52,8 @@
DEFINE_QOBJ_TYPE(ospf6)
FRR_CFG_DEFAULT_BOOL(OSPF6_LOG_ADJACENCY_CHANGES,
- { .val_long = true, .match_profile = "datacenter", },
- { .val_long = false },
+ { .val_bool = true, .match_profile = "datacenter", },
+ { .val_bool = false },
)
/* global ospf6d variable */
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index 1717f1e650..2773a666a3 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -171,8 +171,8 @@ static int ospf6_zebra_read_route(ZAPI_CALLBACK_ARGS)
if (IS_OSPF6_DEBUG_ZEBRA(RECV)) {
char prefixstr[PREFIX2STR_BUFFER], nexthopstr[128];
- prefix2str((struct prefix *)&api.prefix, prefixstr,
- sizeof(prefixstr));
+
+ prefix2str(&api.prefix, prefixstr, sizeof(prefixstr));
inet_ntop(AF_INET6, nexthop, nexthopstr, sizeof(nexthopstr));
zlog_debug(
@@ -256,7 +256,7 @@ static void ospf6_zebra_route_update(int type, struct ospf6_route *request)
&& ospf6_route_is_same(request, request->next)) {
if (IS_OSPF6_DEBUG_ZEBRA(SEND))
zlog_debug(
- " Best-path removal resulted Sencondary addition");
+ " Best-path removal resulted Secondary addition");
type = ADD;
request = request->next;
}