From owner-p4-projects@FreeBSD.ORG Mon Aug 28 14:44:45 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4E53C16A4DE; Mon, 28 Aug 2006 14:44:45 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0849216A4E2 for ; Mon, 28 Aug 2006 14:44:45 +0000 (UTC) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB84343D5E for ; Mon, 28 Aug 2006 14:44:44 +0000 (GMT) (envelope-from piso@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k7SEiiae024524 for ; Mon, 28 Aug 2006 14:44:44 GMT (envelope-from piso@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k7SEiiDE024521 for perforce@freebsd.org; Mon, 28 Aug 2006 14:44:44 GMT (envelope-from piso@freebsd.org) Date: Mon, 28 Aug 2006 14:44:44 GMT Message-Id: <200608281444.k7SEiiDE024521@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to piso@freebsd.org using -f From: Paolo Pisati To: Perforce Change Reviews Cc: Subject: PERFORCE change 105222 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Aug 2006 14:44:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=105222 Change 105222 by piso@piso_newluxor on 2006/08/28 14:43:56 Move malloc&c redefinition for kernel land to alias_local.h Affected files ... .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#5 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#4 edit .. //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_proxy.c#5 edit Differences ... ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_db.c#5 (text+ko) ==== @@ -145,6 +145,7 @@ #ifdef _KERNEL #include #include +#include #else #include #include @@ -157,9 +158,6 @@ #ifdef _KERNEL #include -#include -#include -#include #include #include #else @@ -353,16 +351,8 @@ /* Kernel module definition. */ #ifdef _KERNEL MALLOC_DEFINE(M_ALIAS, "libalias", "packet aliasing"); - MODULE_VERSION(libalias, 1); -/* 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 - static int alias_mod_handler(module_t mod, int type, void *data) { ==== //depot/projects/soc2005/libalias/sys/netinet/libalias/alias_local.h#4 (text+ko) ==== @@ -52,15 +52,25 @@ #ifdef _KERNEL #include +#include +#include #include #include #include #include #endif +#ifdef _KERNEL /* XXX: LibAliasSetTarget() uses this constant. */ -#ifdef _KERNEL #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_proxy.c#5 (text+ko) ==== @@ -156,15 +156,6 @@ static void ProxyEncodeIpHeader(struct ip *, int); #ifdef _KERNEL - -/* Use kernel allocator. */ -#if defined(_SYS_MALLOC_H_) -MALLOC_DECLARE(M_ALIAS); -#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 - static int inet_aton(cp, addr) const char *cp;