PERFORCE change 105321 for review
Paolo Pisati
piso at FreeBSD.org
Wed Aug 30 10:52:33 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=105321
Change 105321 by piso at 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 */
More information about the p4-projects
mailing list