From: David Lamparter <equi...@opensourcerouting.org>
A few places are using 0 in place of the MTYPE_* argument. The
following rewrite of the alloc tracking won't deal with that, so let's
use MTYPE_TMP instead.
Signed-off-by: David Lamparter <equi...@opensourcerouting.org>
Reviewed-by: Philippe Guibert <philippe.guib...@6wind.com>
---
lib/prefix.c | 2 +-
ospfclient/ospf_apiclient.h | 2 +-
ospfd/ospf_opaque.c | 6 +++---
ospfd/ospf_snmp.c | 4 ++--
ospfd/ospf_te.c | 2 +-
vtysh/vtysh_main.c | 4 ++--
vtysh/vtysh_user.c | 2 +-
zebra/zebra_rib.c | 16 ++++++++--------
zebra/zserv.c | 4 ++--
9 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/lib/prefix.c b/lib/prefix.c
index 7b94e787b010..3d82b91a6f96 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -579,7 +579,7 @@ str2prefix_ipv6 (const char *str, struct prefix_ipv6 *p)
{
int plen;
- cp = XMALLOC (0, (pnt - str) + 1);
+ cp = XMALLOC (MTYPE_TMP, (pnt - str) + 1);
strncpy (cp, str, pnt - str);
*(cp + (pnt - str)) = '\0';
ret = inet_pton (AF_INET6, cp, &p->prefix);
diff --git a/ospfclient/ospf_apiclient.h b/ospfclient/ospf_apiclient.h
index 0e74787ae094..809861995e17 100644
--- a/ospfclient/ospf_apiclient.h
+++ b/ospfclient/ospf_apiclient.h
@@ -23,7 +23,7 @@
#ifndef _OSPF_APICLIENT_H
#define _OSPF_APICLIENT_H
-#define MTYPE_OSPF_APICLIENT 0
+#define MTYPE_OSPF_APICLIENT MTYPE_TMP
/* Structure for the OSPF API client */
struct ospf_apiclient
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 61e98f400964..697655d536b2 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -22,9 +22,9 @@
*/
/***** MTYPE definitions are not reflected to "memory.h" yet. *****/
-#define MTYPE_OSPF_OPAQUE_FUNCTAB 0
-#define MTYPE_OPAQUE_INFO_PER_TYPE 0
-#define MTYPE_OPAQUE_INFO_PER_ID 0
+#define MTYPE_OSPF_OPAQUE_FUNCTAB MTYPE_TMP
+#define MTYPE_OPAQUE_INFO_PER_TYPE MTYPE_TMP
+#define MTYPE_OPAQUE_INFO_PER_ID MTYPE_TMP
#include <zebra.h>
diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c
index ebeffa8ea852..1f9b851874cd 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -1420,13 +1420,13 @@ struct ospf_snmp_if
static struct ospf_snmp_if *
ospf_snmp_if_new (void)
{
- return XCALLOC (0, sizeof (struct ospf_snmp_if));
+ return XCALLOC (MTYPE_TMP, sizeof (struct ospf_snmp_if));
}
static void
ospf_snmp_if_free (struct ospf_snmp_if *osif)
{
- XFREE (0, osif);
+ XFREE (MTYPE_TMP, osif);
}
void
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index cd52866be322..03109bc82703 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -22,7 +22,7 @@
*/
/***** MTYPE definition is not reflected to "memory.h" yet. *****/
-#define MTYPE_OSPF_MPLS_TE_LINKPARAMS 0
+#define MTYPE_OSPF_MPLS_TE_LINKPARAMS MTYPE_TMP
#include <zebra.h>
diff --git a/vtysh/vtysh_main.c b/vtysh/vtysh_main.c
index 02a19b7c28cc..3fc0419eceac 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -251,7 +251,7 @@ main (int argc, char **argv, char **env)
case 'c':
{
struct cmd_rec *cr;
- cr = XMALLOC(0, sizeof(*cr));
+ cr = XMALLOC(MTYPE_TMP, sizeof(*cr));
cr->line = optarg;
cr->next = NULL;
if (tail)
@@ -393,7 +393,7 @@ main (int argc, char **argv, char **env)
struct cmd_rec *cr;
cr = cmd;
cmd = cmd->next;
- XFREE(0, cr);
+ XFREE(MTYPE_TMP, cr);
}
}
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c
index 239a633f4889..248b181205dd 100644
--- a/vtysh/vtysh_user.c
+++ b/vtysh/vtysh_user.c
@@ -102,7 +102,7 @@ struct list *userlist;
static struct vtysh_user *
user_new ()
{
- return XCALLOC (0, sizeof (struct vtysh_user));
+ return XCALLOC (MTYPE_TMP, sizeof (struct vtysh_user));
}
#if 0
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 18eece81bc75..031e1fb0fdf2 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -178,7 +178,7 @@ static void
nexthop_free (struct nexthop *nexthop)
{
if (nexthop->ifname)
- XFREE (0, nexthop->ifname);
+ XFREE (MTYPE_TMP, nexthop->ifname);
if (nexthop->resolved)
nexthops_free(nexthop->resolved);
XFREE (MTYPE_NEXTHOP, nexthop);
@@ -218,7 +218,7 @@ nexthop_ifname_add (struct rib *rib, char *ifname)
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop->type = NEXTHOP_TYPE_IFNAME;
- nexthop->ifname = XSTRDUP (0, ifname);
+ nexthop->ifname = XSTRDUP (MTYPE_TMP, ifname);
nexthop_add (rib, nexthop);
@@ -282,7 +282,7 @@ nexthop_ipv6_ifname_add (struct rib *rib, struct in6_addr
*ipv6,
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop->type = NEXTHOP_TYPE_IPV6_IFNAME;
nexthop->gate.ipv6 = *ipv6;
- nexthop->ifname = XSTRDUP (0, ifname);
+ nexthop->ifname = XSTRDUP (MTYPE_TMP, ifname);
nexthop_add (rib, nexthop);
@@ -2464,7 +2464,7 @@ static_add_ipv4_safi (safi_t safi, struct prefix *p,
struct in_addr *gate,
if (gate)
si->addr.ipv4 = *gate;
if (ifname)
- si->ifname = XSTRDUP (0, ifname);
+ si->ifname = XSTRDUP (MTYPE_TMP, ifname);
/* Add new static route information to the tree with sort by
distance value and gateway address. */
@@ -2554,7 +2554,7 @@ static_delete_ipv4_safi (safi_t safi, struct prefix *p,
struct in_addr *gate,
/* Free static route configuration. */
if (ifname)
- XFREE (0, si->ifname);
+ XFREE (MTYPE_TMP, si->ifname);
XFREE (MTYPE_STATIC_ROUTE, si);
route_unlock_node (rn);
@@ -2861,11 +2861,11 @@ static_add_ipv6 (struct prefix *p, u_char type, struct
in6_addr *gate,
si->addr.ipv6 = *gate;
break;
case STATIC_IPV6_IFNAME:
- si->ifname = XSTRDUP (0, ifname);
+ si->ifname = XSTRDUP (MTYPE_TMP, ifname);
break;
case STATIC_IPV6_GATEWAY_IFNAME:
si->addr.ipv6 = *gate;
- si->ifname = XSTRDUP (0, ifname);
+ si->ifname = XSTRDUP (MTYPE_TMP, ifname);
break;
}
@@ -2942,7 +2942,7 @@ static_delete_ipv6 (struct prefix *p, u_char type, struct
in6_addr *gate,
/* Free static route configuration. */
if (ifname)
- XFREE (0, si->ifname);
+ XFREE (MTYPE_TMP, si->ifname);
XFREE (MTYPE_STATIC_ROUTE, si);
return 1;
diff --git a/zebra/zserv.c b/zebra/zserv.c
index 6412f8d6d11a..03c958bc872e 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -1303,7 +1303,7 @@ zebra_client_close (struct zserv *client)
/* Free client structure. */
listnode_delete (zebrad.client_list, client);
- XFREE (0, client);
+ XFREE (MTYPE_TMP, client);
}
/* Make new client. */
@@ -1313,7 +1313,7 @@ zebra_client_create (int sock)
struct zserv *client;
int i;
- client = XCALLOC (0, sizeof (struct zserv));
+ client = XCALLOC (MTYPE_TMP, sizeof (struct zserv));
/* Make client input/output buffer. */
client->sock = sock;