Browse Source

*: 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>
David Lamparter 3 years ago
parent
commit
23757db11c
9 changed files with 16 additions and 16 deletions
  1. 1 1
      lib/prefix.c
  2. 1 1
      ospfclient/ospf_apiclient.h
  3. 3 3
      ospfd/ospf_opaque.c
  4. 2 2
      ospfd/ospf_snmp.c
  5. 1 1
      ospfd/ospf_te.c
  6. 1 1
      vtysh/vtysh_main.c
  7. 1 1
      vtysh/vtysh_user.c
  8. 5 5
      zebra/zebra_rib.c
  9. 1 1
      zebra/zserv.c

+ 1 - 1
lib/prefix.c

@@ -566,7 +566,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);

+ 1 - 1
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

+ 3 - 3
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>
 

+ 2 - 2
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

+ 1 - 1
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>
 

+ 1 - 1
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)

+ 1 - 1
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

+ 5 - 5
zebra/zebra_rib.c

@@ -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. */
@@ -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;
     }
 

+ 1 - 1
zebra/zserv.c

@@ -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;