summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/command.h1
-rw-r--r--lib/routemap.c9
-rw-r--r--lib/routemap.h6
-rw-r--r--lib/stream.c12
-rw-r--r--lib/vrf.h1
5 files changed, 20 insertions, 9 deletions
diff --git a/lib/command.h b/lib/command.h
index 2d333b098a..a001a90e2e 100644
--- a/lib/command.h
+++ b/lib/command.h
@@ -338,6 +338,7 @@ struct cmd_node {
#define UNDEBUG_STR "Disable debugging functions (see also 'debug')\n"
#define ROUTER_STR "Enable a routing process\n"
#define AS_STR "AS number\n"
+#define MAC_STR "MAC address\n"
#define MBGP_STR "MBGP information\n"
#define MATCH_STR "Match values from routing table\n"
#define SET_STR "Set values in destination routing protocol\n"
diff --git a/lib/routemap.c b/lib/routemap.c
index 6c4585365a..4e8682f312 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -2741,6 +2741,15 @@ void route_map_finish(void)
vector_free(route_set_vec);
route_set_vec = NULL;
+ /*
+ * All protocols are setting these to NULL
+ * by default on shutdown( route_map_finish )
+ * Why are we making them do this work?
+ */
+ route_map_master.add_hook = NULL;
+ route_map_master.delete_hook = NULL;
+ route_map_master.event_hook = NULL;
+
/* cleanup route_map */
while (route_map_master.head) {
struct route_map *map = route_map_master.head;
diff --git a/lib/routemap.h b/lib/routemap.h
index 0f7c391f84..a193e32536 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -169,6 +169,12 @@ DECLARE_QOBJ_TYPE(route_map)
/* Prototypes. */
extern void route_map_init(void);
+
+/*
+ * This should only be called on shutdown
+ * Additionally this function sets the hooks to NULL
+ * before any processing is done.
+ */
extern void route_map_finish(void);
/* Add match statement to route map. */
diff --git a/lib/stream.c b/lib/stream.c
index a172eedc99..cf9af4d3bb 100644
--- a/lib/stream.c
+++ b/lib/stream.c
@@ -100,16 +100,12 @@ struct stream *stream_new(size_t size)
assert(size > 0);
- s = XCALLOC(MTYPE_STREAM, sizeof(struct stream));
+ s = XMALLOC(MTYPE_STREAM, sizeof(struct stream));
- if (s == NULL)
- return s;
-
- if ((s->data = XMALLOC(MTYPE_STREAM_DATA, size)) == NULL) {
- XFREE(MTYPE_STREAM, s);
- return NULL;
- }
+ s->data = XMALLOC(MTYPE_STREAM_DATA, size);
+ s->getp = s->endp = 0;
+ s->next = NULL;
s->size = size;
return s;
}
diff --git a/lib/vrf.h b/lib/vrf.h
index 88536eada8..0f4f36be50 100644
--- a/lib/vrf.h
+++ b/lib/vrf.h
@@ -120,7 +120,6 @@ extern vrf_id_t vrf_name_to_id(const char *);
} else { \
vty_out(vty, "%% VRF %s not found\n", NAME); \
} \
- vty_out(vty, "%% VRF %s not found\n", NAME); \
return CMD_WARNING; \
} \
if (vrf->vrf_id == VRF_UNKNOWN) { \