Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Aug 2006 10:52:31 GMT
From:      Paolo Pisati <piso@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 105321 for review
Message-ID:  <200608301052.k7UAqV3a057369@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105321

Change 105321 by piso@piso_newluxor on 2006/08/30 10:51:55

	Ipfw's kernel side defines malloc as M_IPFW/M_IPFW_TBL,
	while libalias uses M_ALIAS: avoid them to clash moving
	libalias malloc redefinition to alias_mod.h. 

Affected files ...

.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#5 edit
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.h#21 edit
.. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#6 edit

Differences ...

==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#5 (text+ko) ====

@@ -63,14 +63,6 @@
 #ifdef _KERNEL
 /* XXX: LibAliasSetTarget() uses this constant. */
 #define	INADDR_NONE	0xffffffff
-MALLOC_DECLARE(M_ALIAS);
-
-/* Use kernel allocator. */
-#if defined(_SYS_MALLOC_H_)
-#define	malloc(x)	malloc(x, M_ALIAS, M_NOWAIT|M_ZERO)
-#define	calloc(x, n)	malloc(x*n)
-#define	free(x)		free(x, M_ALIAS)
-#endif
 #endif
 
 /* Sizes of input and output link tables */

==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_mod.h#21 (text+ko) ====

@@ -32,6 +32,17 @@
 #ifndef _ALIAS_MOD_H_
 #define _ALIAS_MOD_H_
 
+#ifdef _KERNEL
+MALLOC_DECLARE(M_ALIAS);
+
+/* Use kernel allocator. */
+#if defined(_SYS_MALLOC_H_)
+#define	malloc(x)	malloc(x, M_ALIAS, M_NOWAIT|M_ZERO)
+#define	calloc(x, n)	malloc(x*n)
+#define	free(x)		free(x, M_ALIAS)
+#endif
+#endif
+
 /* Protocol handlers struct & function. */
 
 /* Packet flow direction. */

==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#6 (text+ko) ====

@@ -80,6 +80,7 @@
 #ifdef _KERNEL
 #include <netinet/libalias/alias.h>
 #include <netinet/libalias/alias_local.h>
+#include <netinet/libalias/alias_mod.h>
 #else
 #include <arpa/inet.h>
 #include "alias.h"		/* Public API functions for libalias */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608301052.k7UAqV3a057369>