*: get rid of "MTYPE 0"
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 <equinox@opensourcerouting.org>
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/lib/prefix.c b/lib/prefix.c
index 3e4ca16..aeb627b 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -566,7 +566,7 @@
{
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 0e74787..8098619 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 61e98f4..697655d 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 ebeffa8..1f9b851 100644
--- a/ospfd/ospf_snmp.c
+++ b/ospfd/ospf_snmp.c
@@ -1420,13 +1420,13 @@
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 cd52866..03109bc 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 02a19b7..e82771b 100644
--- a/vtysh/vtysh_main.c
+++ b/vtysh/vtysh_main.c
@@ -251,7 +251,7 @@
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)
diff --git a/vtysh/vtysh_user.c b/vtysh/vtysh_user.c
index 239a633..248b181 100644
--- a/vtysh/vtysh_user.c
+++ b/vtysh/vtysh_user.c
@@ -102,7 +102,7 @@
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 18eece8..2e15f99 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -218,7 +218,7 @@
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 = 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 @@
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. */
@@ -2861,11 +2861,11 @@
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;
}
diff --git a/zebra/zserv.c b/zebra/zserv.c
index e0e32ab..c0f9a90 100644
--- a/zebra/zserv.c
+++ b/zebra/zserv.c
@@ -1313,7 +1313,7 @@
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;