Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netkey remove "#ifdef IPSEC_DEBUG" conditional from from...



details:   https://anonhg.NetBSD.org/src/rev/8005688d8ae5
branches:  trunk
changeset: 513760:8005688d8ae5
user:      itojun <itojun%NetBSD.org@localhost>
date:      Sun Aug 12 11:52:43 2001 +0000

description:
remove "#ifdef IPSEC_DEBUG" conditional from from key_debug.h
(headers must have no #if).  sync with kame

diffstat:

 sys/netkey/key.c       |   4 +---
 sys/netkey/key_debug.c |   6 +-----
 sys/netkey/key_debug.h |  17 +++++------------
 3 files changed, 7 insertions(+), 20 deletions(-)

diffs (87 lines):

diff -r 50cbe130d69b -r 8005688d8ae5 sys/netkey/key.c
--- a/sys/netkey/key.c  Sun Aug 12 11:48:27 2001 +0000
+++ b/sys/netkey/key.c  Sun Aug 12 11:52:43 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key.c,v 1.48 2001/08/12 11:48:27 itojun Exp $  */
+/*     $NetBSD: key.c,v 1.49 2001/08/12 11:52:43 itojun Exp $  */
 /*     $KAME: key.c,v 1.203 2001/07/28 03:12:18 itojun Exp $   */
 
 /*
@@ -118,9 +118,7 @@
  *   field hits 0 (= no external reference other than from SA header.
  */
 
-#ifdef IPSEC_DEBUG
 u_int32_t key_debug_level = 0;
-#endif
 static u_int key_spi_trycnt = 1000;
 static u_int32_t key_spi_minval = 0x100;
 static u_int32_t key_spi_maxval = 0x0fffffff;  /* XXX */
diff -r 50cbe130d69b -r 8005688d8ae5 sys/netkey/key_debug.c
--- a/sys/netkey/key_debug.c    Sun Aug 12 11:48:27 2001 +0000
+++ b/sys/netkey/key_debug.c    Sun Aug 12 11:52:43 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: key_debug.c,v 1.16 2001/08/02 12:10:15 itojun Exp $    */
+/*     $NetBSD: key_debug.c,v 1.17 2001/08/12 11:52:44 itojun Exp $    */
 /*     $KAME: key_debug.c,v 1.25 2000/07/24 13:23:12 itojun Exp $      */
 
 /*
@@ -56,8 +56,6 @@
 #include <stdlib.h>
 #endif /* !_KERNEL */
 
-#if !defined(_KERNEL) || (defined(_KERNEL) && defined(IPSEC_DEBUG))
-
 static void kdebug_sadb_prop __P((struct sadb_ext *));
 static void kdebug_sadb_identity __P((struct sadb_ext *));
 static void kdebug_sadb_supported __P((struct sadb_ext *));
@@ -738,5 +736,3 @@
 
        return;
 }
-
-#endif /* !defined(_KERNEL) || (defined(_KERNEL) && defined(IPSEC_DEBUG)) */
diff -r 50cbe130d69b -r 8005688d8ae5 sys/netkey/key_debug.h
--- a/sys/netkey/key_debug.h    Sun Aug 12 11:48:27 2001 +0000
+++ b/sys/netkey/key_debug.h    Sun Aug 12 11:52:43 2001 +0000
@@ -1,5 +1,5 @@
-/*     $NetBSD: key_debug.h,v 1.7 2000/07/04 04:41:54 itojun Exp $     */
-/*     $KAME: key_debug.h,v 1.7 2000/07/04 04:08:16 itojun Exp $       */
+/*     $NetBSD: key_debug.h,v 1.8 2001/08/12 11:52:44 itojun Exp $     */
+/*     $KAME: key_debug.h,v 1.10 2001/08/05 08:37:52 itojun Exp $      */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -33,8 +33,7 @@
 #ifndef _NETKEY_KEY_DEBUG_H_
 #define _NETKEY_KEY_DEBUG_H_
 
-#if !defined(_KERNEL) || (defined(_KERNEL) && defined(IPSEC_DEBUG))
-
+#ifdef _KERNEL
 /* debug flags */
 #define KEYDEBUG_STAMP         0x00000001 /* path */
 #define KEYDEBUG_DATA          0x00000002 /* data */
@@ -54,9 +53,9 @@
 #define KEYDEBUG_IPSEC_DATA    (KEYDEBUG_IPSEC | KEYDEBUG_DATA)
 #define KEYDEBUG_IPSEC_DUMP    (KEYDEBUG_IPSEC | KEYDEBUG_DUMP)
 
-#define KEYDEBUG(lev,arg) if ((key_debug_level & (lev)) == (lev)) { arg; }
+#define KEYDEBUG(lev,arg) \
+       do { if ((key_debug_level & (lev)) == (lev)) { arg; } } while (0)
 
-#ifdef _KERNEL
 extern u_int32_t key_debug_level;
 #endif /*_KERNEL*/
 
@@ -86,10 +85,4 @@
 extern void ipsec_hexdump __P((caddr_t, int));
 extern void ipsec_bindump __P((caddr_t, int));
 
-#else
-
-#define KEYDEBUG(lev,arg)
-
-#endif /*!defined(_KERNEL) || (defined(_KERNEL) && defined(IPSEC_DEBUG))*/
-
 #endif /* _NETKEY_KEY_DEBUG_H_ */



Home | Main Index | Thread Index | Old Index