summaryrefslogtreecommitdiff
path: root/ospf6d
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d')
-rw-r--r--ospf6d/ospf6_area.c3
-rw-r--r--ospf6d/ospf6_asbr.c4
-rw-r--r--ospf6d/ospf6_flood.c13
-rw-r--r--ospf6d/ospf6_interface.c15
-rw-r--r--ospf6d/ospf6_interface.h6
-rw-r--r--ospf6d/ospf6_lsa.c55
-rw-r--r--ospf6d/ospf6_lsa.h1
-rw-r--r--ospf6d/ospf6_lsdb.c2
-rw-r--r--ospf6d/ospf6_main.c3
-rw-r--r--ospf6d/ospf6_memory.c47
-rw-r--r--ospf6d/ospf6_memory.h48
-rw-r--r--ospf6d/ospf6_message.c2
-rw-r--r--ospf6d/ospf6_neighbor.c4
-rw-r--r--ospf6d/ospf6_neighbor.h2
-rw-r--r--ospf6d/ospf6_route.c4
-rw-r--r--ospf6d/ospf6_snmp.c3
-rw-r--r--ospf6d/ospf6_spf.c13
-rw-r--r--ospf6d/ospf6_spf.h2
-rw-r--r--ospf6d/ospf6_top.c10
-rw-r--r--ospf6d/ospf6_top.h4
-rw-r--r--ospf6d/ospf6_zebra.c2
-rw-r--r--ospf6d/ospf6d.c2
-rw-r--r--ospf6d/ospf6d.h3
-rw-r--r--ospf6d/subdir.am4
24 files changed, 103 insertions, 149 deletions
diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c
index cf33069c9f..6bf61b4804 100644
--- a/ospf6d/ospf6_area.c
+++ b/ospf6d/ospf6_area.c
@@ -46,7 +46,8 @@
#include "ospf6d.h"
#include "lib/json.h"
-DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_PLISTNAME, "Prefix list name")
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_AREA, "OSPF6 area");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_PLISTNAME, "Prefix list name");
int ospf6_area_cmp(void *va, void *vb)
{
diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c
index 977d810be5..3497b26656 100644
--- a/ospf6d/ospf6_asbr.c
+++ b/ospf6d/ospf6_asbr.c
@@ -49,6 +49,10 @@
#include "ospf6d.h"
#include "lib/json.h"
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_EXTERNAL_INFO, "OSPF6 ext. info");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_DIST_ARGS, "OSPF6 Distribute arguments");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_REDISTRIBUTE, "OSPF6 Redistribute arguments");
+
static void ospf6_asbr_redistribute_set(int type, vrf_id_t vrf_id);
static void ospf6_asbr_redistribute_unset(struct ospf6 *ospf6,
struct ospf6_redist *red, int type);
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index 2d896546fa..5f4815fec1 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -463,6 +463,19 @@ static void ospf6_flood_process(struct ospf6_neighbor *from,
struct ospf6_area *oa;
for (ALL_LIST_ELEMENTS(process->area_list, node, nnode, oa)) {
+
+ /* If unknown LSA and U-bit clear, treat as link local
+ * flooding scope
+ */
+ if (!OSPF6_LSA_IS_KNOWN(lsa->header->type)
+ && !(ntohs(lsa->header->type) & OSPF6_LSTYPE_UBIT_MASK)
+ && (oa != OSPF6_INTERFACE(lsa->lsdb->data)->area)) {
+
+ if (IS_OSPF6_DEBUG_FLOODING)
+ zlog_debug("Unknown LSA, do not flood");
+ continue;
+ }
+
if (OSPF6_LSA_SCOPE(lsa->header->type) == OSPF6_SCOPE_AREA
&& oa != OSPF6_AREA(lsa->lsdb->data))
continue;
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index a5d9138743..158b8dc483 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -45,11 +45,12 @@
#include "ospf6_zebra.h"
#include "lib/json.h"
-DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names")
-DEFINE_QOBJ_TYPE(ospf6_interface)
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_IF, "OSPF6 interface");
+DEFINE_MTYPE_STATIC(OSPF6D, CFG_PLIST_NAME, "configured prefix list names");
+DEFINE_QOBJ_TYPE(ospf6_interface);
DEFINE_HOOK(ospf6_interface_change,
(struct ospf6_interface * oi, int state, int old_state),
- (oi, state, old_state))
+ (oi, state, old_state));
unsigned char conf_debug_ospf6_interface = 0;
@@ -1449,6 +1450,12 @@ DEFUN (show_ipv6_ospf6_interface_ifname_prefix,
return CMD_WARNING;
}
+ if (CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE)) {
+ vty_out(vty, "Interface %s not attached to area\n",
+ argv[idx_ifname]->arg);
+ return CMD_WARNING;
+ }
+
ospf6_route_table_show(vty, idx_prefix, argc, argv, oi->route_connected,
uj);
@@ -1482,7 +1489,7 @@ DEFUN (show_ipv6_ospf6_interface_prefix,
FOR_ALL_INTERFACES (vrf, ifp) {
oi = (struct ospf6_interface *)ifp->info;
- if (oi == NULL)
+ if (oi == NULL || CHECK_FLAG(oi->flag, OSPF6_INTERFACE_DISABLE))
continue;
ospf6_route_table_show(vty, idx_prefix, argc, argv,
diff --git a/ospf6d/ospf6_interface.h b/ospf6d/ospf6_interface.h
index 6e4692920c..2a5a9ba4a2 100644
--- a/ospf6d/ospf6_interface.h
+++ b/ospf6d/ospf6_interface.h
@@ -134,9 +134,9 @@ struct ospf6_interface {
uint32_t ls_ack_out;
uint32_t discarded;
- QOBJ_FIELDS
+ QOBJ_FIELDS;
};
-DECLARE_QOBJ_TYPE(ospf6_interface)
+DECLARE_QOBJ_TYPE(ospf6_interface);
/* interface state */
#define OSPF6_INTERFACE_NONE 0
@@ -199,6 +199,6 @@ extern void install_element_ospf6_debug_interface(void);
DECLARE_HOOK(ospf6_interface_change,
(struct ospf6_interface * oi, int state, int old_state),
- (oi, state, old_state))
+ (oi, state, old_state));
#endif /* OSPF6_INTERFACE_H */
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index e1c3b4038c..b4f0c30f12 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -43,6 +43,10 @@
#include "ospf6_flood.h"
#include "ospf6d.h"
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSA, "OSPF6 LSA");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSA_HEADER, "OSPF6 LSA header");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSA_SUMMARY, "OSPF6 LSA summary");
+
vector ospf6_lsa_handler_vector;
struct ospf6 *ospf6_get_by_lsdb(struct ospf6_lsa *lsa)
@@ -657,27 +661,29 @@ void ospf6_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
vty_out(vty, "\n");
}
+struct ospf6_lsa *ospf6_lsa_alloc(size_t lsa_length)
+{
+ struct ospf6_lsa *lsa;
+
+ lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
+ lsa->header = XMALLOC(MTYPE_OSPF6_LSA_HEADER, lsa_length);
+
+ return lsa;
+}
+
/* OSPFv3 LSA creation/deletion function */
struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header)
{
struct ospf6_lsa *lsa = NULL;
- struct ospf6_lsa_header *new_header = NULL;
uint16_t lsa_size = 0;
/* size of the entire LSA */
lsa_size = ntohs(header->length); /* XXX vulnerable */
- /* allocate memory for this LSA */
- new_header = XMALLOC(MTYPE_OSPF6_LSA_HEADER, lsa_size);
+ lsa = ospf6_lsa_alloc(lsa_size);
/* copy LSA from original header */
- memcpy(new_header, header, lsa_size);
-
- /* LSA information structure */
- /* allocate memory */
- lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
-
- lsa->header = new_header;
+ memcpy(lsa->header, header, lsa_size);
/* dump string */
ospf6_lsa_printbuf(lsa, lsa->name, sizeof(lsa->name));
@@ -691,20 +697,11 @@ struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header)
struct ospf6_lsa *ospf6_lsa_create_headeronly(struct ospf6_lsa_header *header)
{
struct ospf6_lsa *lsa = NULL;
- struct ospf6_lsa_header *new_header = NULL;
-
- /* allocate memory for this LSA */
- new_header = XMALLOC(MTYPE_OSPF6_LSA_HEADER,
- sizeof(struct ospf6_lsa_header));
- /* copy LSA from original header */
- memcpy(new_header, header, sizeof(struct ospf6_lsa_header));
+ lsa = ospf6_lsa_alloc(sizeof(struct ospf6_lsa_header));
- /* LSA information structure */
- /* allocate memory */
- lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
+ memcpy(lsa->header, header, sizeof(struct ospf6_lsa_header));
- lsa->header = new_header;
SET_FLAG(lsa->flag, OSPF6_LSA_HEADERONLY);
/* dump string */
@@ -856,11 +853,12 @@ int ospf6_lsa_refresh(struct thread *thread)
void ospf6_flush_self_originated_lsas_now(struct ospf6 *ospf6)
{
- struct listnode *node;
+ struct listnode *node, *nnode;
struct ospf6_area *oa;
struct ospf6_lsa *lsa;
const struct route_node *end = NULL;
uint32_t type, adv_router;
+ struct ospf6_interface *oi;
ospf6->inst_shutdown = 1;
@@ -875,6 +873,19 @@ void ospf6_flush_self_originated_lsas_now(struct ospf6 *ospf6)
lsa = ospf6_lsdb_next(end, lsa);
}
+
+ for (ALL_LIST_ELEMENTS(oa->if_list, node, nnode, oi)) {
+ end = ospf6_lsdb_head(oi->lsdb_self, 0, 0,
+ ospf6->router_id, &lsa);
+ while (lsa) {
+ /* RFC 2328 (14.1): Set MAXAGE */
+ lsa->header->age = htons(OSPF_LSA_MAXAGE);
+ /* Flood MAXAGE LSA*/
+ ospf6_flood(NULL, lsa);
+
+ lsa = ospf6_lsdb_next(end, lsa);
+ }
+ }
}
type = htons(OSPF6_LSTYPE_AS_EXTERNAL);
diff --git a/ospf6d/ospf6_lsa.h b/ospf6d/ospf6_lsa.h
index 7fa9c5fe40..c4d0290c0c 100644
--- a/ospf6d/ospf6_lsa.h
+++ b/ospf6d/ospf6_lsa.h
@@ -217,6 +217,7 @@ extern void ospf6_lsa_show_internal(struct vty *vty, struct ospf6_lsa *lsa,
extern void ospf6_lsa_show(struct vty *vty, struct ospf6_lsa *lsa,
json_object *json, bool use_json);
+extern struct ospf6_lsa *ospf6_lsa_alloc(size_t lsa_length);
extern struct ospf6_lsa *ospf6_lsa_create(struct ospf6_lsa_header *header);
extern struct ospf6_lsa *
ospf6_lsa_create_headeronly(struct ospf6_lsa_header *header);
diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c
index 9636e1a230..18f121e3a2 100644
--- a/ospf6d/ospf6_lsdb.c
+++ b/ospf6d/ospf6_lsdb.c
@@ -34,6 +34,8 @@
#include "ospf6d.h"
#include "bitfield.h"
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_LSDB, "OSPF6 LSA database");
+
struct ospf6_lsdb *ospf6_lsdb_create(void *data)
{
struct ospf6_lsdb *lsdb;
diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c
index 69424f4b46..c601693a7e 100644
--- a/ospf6d/ospf6_main.c
+++ b/ospf6d/ospf6_main.c
@@ -182,7 +182,8 @@ FRR_DAEMON_INFO(ospf6d, OSPF6, .vty_port = OSPF6_VTY_PORT,
.n_signals = array_size(ospf6_signals),
.privs = &ospf6d_privs, .yang_modules = ospf6d_yang_modules,
- .n_yang_modules = array_size(ospf6d_yang_modules), )
+ .n_yang_modules = array_size(ospf6d_yang_modules),
+);
/* Main routine of ospf6d. Treatment of argument and starting ospf finite
state machine is handled here. */
diff --git a/ospf6d/ospf6_memory.c b/ospf6d/ospf6_memory.c
deleted file mode 100644
index 6585fc1580..0000000000
--- a/ospf6d/ospf6_memory.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* ospf6d memory type definitions
- *
- * Copyright (C) 2015 David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "ospf6_memory.h"
-
-DEFINE_MGROUP(OSPF6D, "ospf6d")
-DEFINE_MTYPE(OSPF6D, OSPF6_TOP, "OSPF6 top")
-DEFINE_MTYPE(OSPF6D, OSPF6_AREA, "OSPF6 area")
-DEFINE_MTYPE(OSPF6D, OSPF6_IF, "OSPF6 interface")
-DEFINE_MTYPE(OSPF6D, OSPF6_NEIGHBOR, "OSPF6 neighbor")
-DEFINE_MTYPE(OSPF6D, OSPF6_ROUTE, "OSPF6 route")
-DEFINE_MTYPE(OSPF6D, OSPF6_PREFIX, "OSPF6 prefix")
-DEFINE_MTYPE(OSPF6D, OSPF6_MESSAGE, "OSPF6 message")
-DEFINE_MTYPE(OSPF6D, OSPF6_LSA, "OSPF6 LSA")
-DEFINE_MTYPE(OSPF6D, OSPF6_LSA_HEADER, "OSPF6 LSA header")
-DEFINE_MTYPE(OSPF6D, OSPF6_LSA_SUMMARY, "OSPF6 LSA summary")
-DEFINE_MTYPE(OSPF6D, OSPF6_LSDB, "OSPF6 LSA database")
-DEFINE_MTYPE(OSPF6D, OSPF6_VERTEX, "OSPF6 vertex")
-DEFINE_MTYPE(OSPF6D, OSPF6_SPFTREE, "OSPF6 SPF tree")
-DEFINE_MTYPE(OSPF6D, OSPF6_NEXTHOP, "OSPF6 nexthop")
-DEFINE_MTYPE(OSPF6D, OSPF6_EXTERNAL_INFO, "OSPF6 ext. info")
-DEFINE_MTYPE(OSPF6D, OSPF6_PATH, "OSPF6 Path")
-DEFINE_MTYPE(OSPF6D, OSPF6_DIST_ARGS, "OSPF6 Distribute arguments")
-DEFINE_MTYPE(OSPF6D, OSPF6_OTHER, "OSPF6 other")
-DEFINE_MTYPE(OSPF6D, OSPF6_REDISTRIBUTE, "OSPF6 Redistribute arguments")
diff --git a/ospf6d/ospf6_memory.h b/ospf6d/ospf6_memory.h
deleted file mode 100644
index 57f0abd9a8..0000000000
--- a/ospf6d/ospf6_memory.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* ospf6d memory type declarations
- *
- * Copyright (C) 2015 David Lamparter
- *
- * This file is part of Quagga.
- *
- * Quagga is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * Quagga is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _QUAGGA_OSPF6_MEMORY_H
-#define _QUAGGA_OSPF6_MEMORY_H
-
-#include "memory.h"
-
-DECLARE_MGROUP(OSPF6D)
-DECLARE_MTYPE(OSPF6_TOP)
-DECLARE_MTYPE(OSPF6_AREA)
-DECLARE_MTYPE(OSPF6_IF)
-DECLARE_MTYPE(OSPF6_NEIGHBOR)
-DECLARE_MTYPE(OSPF6_ROUTE)
-DECLARE_MTYPE(OSPF6_PREFIX)
-DECLARE_MTYPE(OSPF6_MESSAGE)
-DECLARE_MTYPE(OSPF6_LSA)
-DECLARE_MTYPE(OSPF6_LSA_HEADER)
-DECLARE_MTYPE(OSPF6_LSA_SUMMARY)
-DECLARE_MTYPE(OSPF6_LSDB)
-DECLARE_MTYPE(OSPF6_VERTEX)
-DECLARE_MTYPE(OSPF6_SPFTREE)
-DECLARE_MTYPE(OSPF6_NEXTHOP)
-DECLARE_MTYPE(OSPF6_EXTERNAL_INFO)
-DECLARE_MTYPE(OSPF6_PATH)
-DECLARE_MTYPE(OSPF6_DIST_ARGS)
-DECLARE_MTYPE(OSPF6_REDISTRIBUTE)
-DECLARE_MTYPE(OSPF6_OTHER)
-
-#endif /* _QUAGGA_OSPF6_MEMORY_H */
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index aebe43b9ec..7aedd3df45 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -49,6 +49,8 @@
#include <netinet/ip6.h>
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_MESSAGE, "OSPF6 message");
+
unsigned char conf_debug_ospf6_message[6] = {0x03, 0, 0, 0, 0, 0};
static const struct message ospf6_message_type_str[] = {
{OSPF6_MESSAGE_TYPE_HELLO, "Hello"},
diff --git a/ospf6d/ospf6_neighbor.c b/ospf6d/ospf6_neighbor.c
index 7a1b96c2b3..485bde4b7b 100644
--- a/ospf6d/ospf6_neighbor.c
+++ b/ospf6d/ospf6_neighbor.c
@@ -46,9 +46,11 @@
#include "ospf6_zebra.h"
#include "lib/json.h"
+DEFINE_MTYPE(OSPF6D, OSPF6_NEIGHBOR, "OSPF6 neighbor");
+
DEFINE_HOOK(ospf6_neighbor_change,
(struct ospf6_neighbor * on, int state, int next_state),
- (on, state, next_state))
+ (on, state, next_state));
unsigned char conf_debug_ospf6_neighbor = 0;
diff --git a/ospf6d/ospf6_neighbor.h b/ospf6d/ospf6_neighbor.h
index 94300ff2ba..f45b340507 100644
--- a/ospf6d/ospf6_neighbor.h
+++ b/ospf6d/ospf6_neighbor.h
@@ -166,6 +166,6 @@ extern void install_element_ospf6_debug_neighbor(void);
DECLARE_HOOK(ospf6_neighbor_change,
(struct ospf6_neighbor * on, int state, int next_state),
- (on, state, next_state))
+ (on, state, next_state));
#endif /* OSPF6_NEIGHBOR_H */
diff --git a/ospf6d/ospf6_route.c b/ospf6d/ospf6_route.c
index b77f968179..9770dd0444 100644
--- a/ospf6d/ospf6_route.c
+++ b/ospf6d/ospf6_route.c
@@ -38,6 +38,10 @@
#include "ospf6d.h"
#include "ospf6_zebra.h"
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_ROUTE, "OSPF6 route");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_NEXTHOP, "OSPF6 nexthop");
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_PATH, "OSPF6 Path");
+
unsigned char conf_debug_ospf6_route = 0;
static char *ospf6_route_table_name(struct ospf6_route_table *table)
diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c
index 51a3bff2a3..b9d413c3df 100644
--- a/ospf6d/ospf6_snmp.c
+++ b/ospf6d/ospf6_snmp.c
@@ -1418,4 +1418,5 @@ static int ospf6_snmp_module_init(void)
FRR_MODULE_SETUP(.name = "ospf6d_snmp", .version = FRR_VERSION,
.description = "ospf6d AgentX SNMP module",
- .init = ospf6_snmp_module_init, )
+ .init = ospf6_snmp_module_init,
+);
diff --git a/ospf6d/ospf6_spf.c b/ospf6d/ospf6_spf.c
index 121e846843..7652d71c59 100644
--- a/ospf6d/ospf6_spf.c
+++ b/ospf6d/ospf6_spf.c
@@ -43,6 +43,8 @@
#include "ospf6d.h"
#include "ospf6_abr.h"
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_VERTEX, "OSPF6 vertex");
+
unsigned char conf_debug_ospf6_spf = 0;
static void ospf6_spf_copy_nexthops_to_route(struct ospf6_route *rt,
@@ -86,7 +88,7 @@ static int ospf6_vertex_cmp(const struct ospf6_vertex *va,
return 0;
}
DECLARE_SKIPLIST_NONUNIQ(vertex_pqueue, struct ospf6_vertex, pqi,
- ospf6_vertex_cmp)
+ ospf6_vertex_cmp);
static int ospf6_vertex_id_cmp(void *a, void *b)
{
@@ -1021,13 +1023,8 @@ struct ospf6_lsa *ospf6_create_single_router_lsa(struct ospf6_area *area,
return NULL;
}
- /* Allocate memory for this LSA */
- new_header = XMALLOC(MTYPE_OSPF6_LSA_HEADER, total_lsa_length);
-
- /* LSA information structure */
- lsa = XCALLOC(MTYPE_OSPF6_LSA, sizeof(struct ospf6_lsa));
-
- lsa->header = (struct ospf6_lsa_header *)new_header;
+ lsa = ospf6_lsa_alloc(total_lsa_length);
+ new_header = (uint8_t *)lsa->header;
lsa->lsdb = area->temp_router_lsa_lsdb;
diff --git a/ospf6d/ospf6_spf.h b/ospf6d/ospf6_spf.h
index 36e2b27912..523b318d5b 100644
--- a/ospf6d/ospf6_spf.h
+++ b/ospf6d/ospf6_spf.h
@@ -35,7 +35,7 @@ extern unsigned char conf_debug_ospf6_spf;
#define IS_OSPF6_DEBUG_SPF(level) \
(conf_debug_ospf6_spf & OSPF6_DEBUG_SPF_##level)
-PREDECL_SKIPLIST_NONUNIQ(vertex_pqueue)
+PREDECL_SKIPLIST_NONUNIQ(vertex_pqueue);
/* Transit Vertex */
struct ospf6_vertex {
/* type of this vertex */
diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c
index 3f72ec828e..a38f1cbc45 100644
--- a/ospf6d/ospf6_top.c
+++ b/ospf6d/ospf6_top.c
@@ -53,12 +53,14 @@
#include "ospf6d.h"
#include "lib/json.h"
-DEFINE_QOBJ_TYPE(ospf6)
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_TOP, "OSPF6 top");
+
+DEFINE_QOBJ_TYPE(ospf6);
FRR_CFG_DEFAULT_BOOL(OSPF6_LOG_ADJACENCY_CHANGES,
{ .val_bool = true, .match_profile = "datacenter", },
{ .val_bool = false },
-)
+);
/* global ospf6d variable */
static struct ospf6_master ospf6_master;
@@ -809,7 +811,8 @@ DEFUN (no_ospf6_interface_area,
/* Verify Area */
if (oi->area == NULL) {
- vty_out(vty, "No such Area-ID: %s\n", argv[idx_ipv4]->arg);
+ vty_out(vty, "%s not attached to area %s\n",
+ oi->interface->name, oi->area->name);
return CMD_SUCCESS;
}
@@ -830,7 +833,6 @@ DEFUN (no_ospf6_interface_area,
UNSET_FLAG(oa->flag, OSPF6_AREA_ENABLE);
ospf6_abr_disable_area(oa);
}
- ospf6_interface_delete(oi);
return CMD_SUCCESS;
}
diff --git a/ospf6d/ospf6_top.h b/ospf6d/ospf6_top.h
index 75dff86cd7..7980659e68 100644
--- a/ospf6d/ospf6_top.h
+++ b/ospf6d/ospf6_top.h
@@ -132,9 +132,9 @@ struct ospf6 {
*/
uint16_t max_multipath;
- QOBJ_FIELDS
+ QOBJ_FIELDS;
};
-DECLARE_QOBJ_TYPE(ospf6)
+DECLARE_QOBJ_TYPE(ospf6);
#define OSPF6_DISABLED 0x01
#define OSPF6_STUB_ROUTER 0x02
diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c
index 9b9453ce24..8d5e0f0a39 100644
--- a/ospf6d/ospf6_zebra.c
+++ b/ospf6d/ospf6_zebra.c
@@ -42,7 +42,7 @@
#include "ospf6_area.h"
#include "lib/json.h"
-DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_DISTANCE, "OSPF6 distance")
+DEFINE_MTYPE_STATIC(OSPF6D, OSPF6_DISTANCE, "OSPF6 distance");
unsigned char conf_debug_ospf6_zebra = 0;
diff --git a/ospf6d/ospf6d.c b/ospf6d/ospf6d.c
index 8d9c85fd08..91d427c78c 100644
--- a/ospf6d/ospf6d.c
+++ b/ospf6d/ospf6d.c
@@ -46,6 +46,8 @@
#include "ospf6_bfd.h"
#include "lib/json.h"
+DEFINE_MGROUP(OSPF6D, "ospf6d");
+
struct route_node *route_prev(struct route_node *node)
{
struct route_node *end;
diff --git a/ospf6d/ospf6d.h b/ospf6d/ospf6d.h
index d85ff40f32..3f9461c7f0 100644
--- a/ospf6d/ospf6d.h
+++ b/ospf6d/ospf6d.h
@@ -23,8 +23,9 @@
#include "libospf.h"
#include "thread.h"
+#include "memory.h"
-#include "ospf6_memory.h"
+DECLARE_MGROUP(OSPF6D);
/* global variables */
extern struct thread_master *master;
diff --git a/ospf6d/subdir.am b/ospf6d/subdir.am
index ec6e593533..82d880cca8 100644
--- a/ospf6d/subdir.am
+++ b/ospf6d/subdir.am
@@ -40,7 +40,6 @@ ospf6d_libospf6_a_SOURCES = \
ospf6d/ospf6_intra.c \
ospf6d/ospf6_lsa.c \
ospf6d/ospf6_lsdb.c \
- ospf6d/ospf6_memory.c \
ospf6d/ospf6_message.c \
ospf6d/ospf6_neighbor.c \
ospf6d/ospf6_network.c \
@@ -62,7 +61,6 @@ noinst_HEADERS += \
ospf6d/ospf6_intra.h \
ospf6d/ospf6_lsa.h \
ospf6d/ospf6_lsdb.h \
- ospf6d/ospf6_memory.h \
ospf6d/ospf6_message.h \
ospf6d/ospf6_neighbor.h \
ospf6d/ospf6_network.h \
@@ -80,6 +78,6 @@ ospf6d_ospf6d_SOURCES = \
# end
ospf6d_ospf6d_snmp_la_SOURCES = ospf6d/ospf6_snmp.c
-ospf6d_ospf6d_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu99
+ospf6d_ospf6d_snmp_la_CFLAGS = $(WERROR) $(SNMP_CFLAGS) -std=gnu11
ospf6d_ospf6d_snmp_la_LDFLAGS = -avoid-version -module -shared -export-dynamic
ospf6d_ospf6d_snmp_la_LIBADD = lib/libfrrsnmp.la