summaryrefslogtreecommitdiff
path: root/sbin/isakmpd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-08 19:40:04 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-08 19:40:04 +0000
commit7694afebc8971e63f138cc95f232083bbb8ad5c3 (patch)
tree9d941349df439502214c099ab85024ce1879a241 /sbin/isakmpd
parent0aacf7aa8665e2af32cc4f083c46aaa3e856417f (diff)
USE_DEBUG is bye bye
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r--sbin/isakmpd/Makefile4
-rw-r--r--sbin/isakmpd/connection.c6
-rw-r--r--sbin/isakmpd/doi.h4
-rw-r--r--sbin/isakmpd/dpd.c6
-rw-r--r--sbin/isakmpd/exchange.c16
-rw-r--r--sbin/isakmpd/ipsec.c13
-rw-r--r--sbin/isakmpd/isakmp_doi.c10
-rw-r--r--sbin/isakmpd/isakmpd.c16
-rw-r--r--sbin/isakmpd/log.c20
-rw-r--r--sbin/isakmpd/log.h11
-rw-r--r--sbin/isakmpd/message.c10
-rw-r--r--sbin/isakmpd/pf_key_v2.c18
-rw-r--r--sbin/isakmpd/ui.c6
-rw-r--r--sbin/isakmpd/virtual.c4
14 files changed, 15 insertions, 129 deletions
diff --git a/sbin/isakmpd/Makefile b/sbin/isakmpd/Makefile
index 0998fb5d4e2..bb049968fe3 100644
--- a/sbin/isakmpd/Makefile
+++ b/sbin/isakmpd/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.73 2005/04/08 19:19:39 hshoexer Exp $
+# $OpenBSD: Makefile,v 1.74 2005/04/08 19:40:02 deraadt Exp $
# $EOM: Makefile,v 1.78 2000/10/15 21:33:42 niklas Exp $
#
@@ -40,7 +40,7 @@ OS= openbsd
# Compile-time configuration of otherwise optional features
#FEATURES+= dnssec
-FEATURES+= debug
+FEATURES+=
.PATH: ${.CURDIR}/sysdep/${OS}
diff --git a/sbin/isakmpd/connection.c b/sbin/isakmpd/connection.c
index 9a0dad325e2..b3c4af95d8f 100644
--- a/sbin/isakmpd/connection.c
+++ b/sbin/isakmpd/connection.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: connection.c,v 1.30 2005/04/04 19:31:11 deraadt Exp $ */
+/* $OpenBSD: connection.c,v 1.31 2005/04/08 19:40:02 deraadt Exp $ */
/* $EOM: connection.c,v 1.28 2000/11/23 12:21:18 niklas Exp $ */
/*
@@ -400,10 +400,8 @@ connection_report(void)
{
struct connection *conn;
struct timeval now;
-#ifdef USE_DEBUG
struct connection_passive *pconn;
struct doi *doi = doi_lookup(ISAKMP_DOI_ISAKMP);
-#endif
gettimeofday(&now, 0);
for (conn = TAILQ_FIRST(&connections); conn;
@@ -412,7 +410,6 @@ connection_report(void)
"connection_report: connection %s next check %ld seconds",
(conn->name ? conn->name : "<unnamed>"),
conn->ev->expiration.tv_sec - now.tv_sec));
-#ifdef USE_DEBUG
for (pconn = TAILQ_FIRST(&connections_passive); pconn;
pconn = TAILQ_NEXT(pconn, link))
LOG_DBG((LOG_REPORT, 0,
@@ -420,7 +417,6 @@ connection_report(void)
doi->decode_ids("local_id: %s, remote_id: %s",
pconn->local_id, pconn->local_sz,
pconn->remote_id, pconn->remote_sz, 1)));
-#endif
}
/* Reinitialize all connections (SIGHUP handling). */
diff --git a/sbin/isakmpd/doi.h b/sbin/isakmpd/doi.h
index f2bcc68b676..8759e939bfe 100644
--- a/sbin/isakmpd/doi.h
+++ b/sbin/isakmpd/doi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: doi.h,v 1.14 2004/05/14 08:42:56 hshoexer Exp $ */
+/* $OpenBSD: doi.h,v 1.15 2005/04/08 19:40:02 deraadt Exp $ */
/* $EOM: doi.h,v 1.29 2000/07/02 18:47:15 provos Exp $ */
/*
@@ -56,10 +56,8 @@ struct doi {
/* Size of DOI-specific protocol data. */
size_t proto_size;
-#ifdef USE_DEBUG
int (*debug_attribute)(u_int16_t, u_int8_t *, u_int16_t,
void *);
-#endif
void (*delete_spi)(struct sa *, struct proto *, int);
int16_t *(*exchange_script)(u_int8_t);
void (*finalize_exchange)(struct message *);
diff --git a/sbin/isakmpd/dpd.c b/sbin/isakmpd/dpd.c
index 9b646822d7c..745c8b79cac 100644
--- a/sbin/isakmpd/dpd.c
+++ b/sbin/isakmpd/dpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dpd.c,v 1.10 2005/04/04 19:31:11 deraadt Exp $ */
+/* $OpenBSD: dpd.c,v 1.11 2005/04/08 19:40:02 deraadt Exp $ */
/*
* Copyright (c) 2004 Håkan Olsson. All rights reserved.
@@ -297,10 +297,8 @@ dpd_event(void *v_sa)
{
struct sa *isakmp_sa = v_sa;
struct dpd_args args;
-#if defined (USE_DEBUG)
struct sockaddr *dst;
char *addr;
-#endif
isakmp_sa->dpd_event = 0;
@@ -326,7 +324,6 @@ dpd_event(void *v_sa)
} else
isakmp_sa->dpd_seq++;
-#if defined (USE_DEBUG)
isakmp_sa->transport->vtbl->get_dst(isakmp_sa->transport, &dst);
if (sockaddr2text(dst, &addr, 0) == -1)
addr = 0;
@@ -334,7 +331,6 @@ dpd_event(void *v_sa)
addr ? addr : "<unknown>", isakmp_sa->dpd_seq));
if (addr)
free(addr);
-#endif
message_send_dpd_notify(isakmp_sa, ISAKMP_NOTIFY_STATUS_DPD_R_U_THERE,
isakmp_sa->dpd_seq);
diff --git a/sbin/isakmpd/exchange.c b/sbin/isakmpd/exchange.c
index 662bf2aa43c..7977ed6f98b 100644
--- a/sbin/isakmpd/exchange.c
+++ b/sbin/isakmpd/exchange.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exchange.c,v 1.117 2005/04/08 18:47:19 hshoexer Exp $ */
+/* $OpenBSD: exchange.c,v 1.118 2005/04/08 19:40:02 deraadt Exp $ */
/* $EOM: exchange.c,v 1.143 2000/12/04 00:02:25 angelos Exp $ */
/*
@@ -73,9 +73,7 @@
*/
#define MAX_BUCKET_BITS 16
-#ifdef USE_DEBUG
static void exchange_dump(char *, struct exchange *);
-#endif
static void exchange_free_aux(void *);
#if 0
static void exchange_resize(void);
@@ -824,9 +822,7 @@ exchange_establish_p1(struct transport *t, u_int8_t type, u_int32_t doi,
exchange_add_finalization(exchange, finalize, arg);
cookie_gen(t, exchange, exchange->cookies, ISAKMP_HDR_ICOOKIE_LEN);
exchange_enter(exchange);
-#ifdef USE_DEBUG
exchange_dump("exchange_establish_p1", exchange);
-#endif
msg = message_alloc(t, 0, ISAKMP_HDR_SZ);
if (!msg) {
@@ -940,9 +936,7 @@ exchange_establish_p2(struct sa *isakmp_sa, u_int8_t type, char *name,
if (isakmp_sa->flags & SA_FLAG_NAT_T_KEEPALIVE)
exchange->flags |= EXCHANGE_FLAG_NAT_T_KEEPALIVE;
exchange_enter(exchange);
-#ifdef USE_DEBUG
exchange_dump("exchange_establish_p2", exchange);
-#endif
/*
* Do not create SA's for informational exchanges.
@@ -1101,9 +1095,7 @@ exchange_setup_p1(struct message *msg, u_int32_t doi)
ISAKMP_HDR_ICOOKIE_LEN, ISAKMP_HDR_RCOOKIE_LEN);
GET_ISAKMP_HDR_ICOOKIE(msg->iov[0].iov_base, exchange->cookies);
exchange_enter(exchange);
-#ifdef USE_DEBUG
exchange_dump("exchange_setup_p1", exchange);
-#endif
return exchange;
}
@@ -1126,9 +1118,7 @@ exchange_setup_p2(struct message *msg, u_int8_t doi)
if (msg->isakmp_sa && (msg->isakmp_sa->flags & SA_FLAG_NAT_T_KEEPALIVE))
exchange->flags |= EXCHANGE_FLAG_NAT_T_KEEPALIVE;
exchange_enter(exchange);
-#ifdef USE_DEBUG
exchange_dump("exchange_setup_p2", exchange);
-#endif
return exchange;
}
@@ -1169,13 +1159,11 @@ exchange_dump_real(char *header, struct exchange *exchange, int class,
decode_32(exchange->message_id), buf));
}
-#ifdef USE_DEBUG
static void
exchange_dump(char *header, struct exchange *exchange)
{
exchange_dump_real(header, exchange, LOG_EXCHANGE, 10);
}
-#endif
void
exchange_report(void)
@@ -1335,9 +1323,7 @@ exchange_finalize(struct message *msg)
int i;
char *id_doi, *id_trp;
-#ifdef USE_DEBUG
exchange_dump("exchange_finalize", exchange);
-#endif
/* Copy the ID from phase 1 to exchange or phase 2 SA. */
if (msg->isakmp_sa) {
diff --git a/sbin/isakmpd/ipsec.c b/sbin/isakmpd/ipsec.c
index 32be08d061a..3b5c54a80ec 100644
--- a/sbin/isakmpd/ipsec.c
+++ b/sbin/isakmpd/ipsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec.c,v 1.115 2005/04/08 16:52:41 deraadt Exp $ */
+/* $OpenBSD: ipsec.c,v 1.116 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: ipsec.c,v 1.143 2000/12/11 23:57:42 niklas Exp $ */
/*
@@ -97,10 +97,8 @@ int contact_cnt = 0, contact_limit = 0;
static int addr_cmp(const void *, const void *);
static int ipsec_add_contact(struct message *);
static int ipsec_contacted(struct message *);
-#ifdef USE_DEBUG
static int ipsec_debug_attribute(u_int16_t, u_int8_t *, u_int16_t,
void *);
-#endif
static void ipsec_delete_spi(struct sa *, struct proto *, int);
static int16_t *ipsec_exchange_script(u_int8_t);
static void ipsec_finalize_exchange(struct message *);
@@ -135,9 +133,7 @@ static struct doi ipsec_doi = {
{0}, IPSEC_DOI_IPSEC,
sizeof(struct ipsec_exch), sizeof(struct ipsec_sa),
sizeof(struct ipsec_proto),
-#ifdef USE_DEBUG
ipsec_debug_attribute,
-#endif
ipsec_delete_spi,
ipsec_exchange_script,
ipsec_finalize_exchange,
@@ -292,9 +288,7 @@ ipsec_finalize_exchange(struct message *msg)
struct ipsec_exch *ie = exchange->data;
struct sa *sa = 0, *old_sa;
struct proto *proto, *last_proto = 0;
-#ifdef USE_DEBUG
char *addr1, *addr2, *mask1, *mask2;
-#endif
switch (exchange->phase) {
case 1:
@@ -383,7 +377,6 @@ ipsec_finalize_exchange(struct message *msg)
last_proto = proto;
}
-#ifdef USE_DEBUG
if (sockaddr2text(isa->src_net, &addr1, 0))
addr1 = 0;
if (sockaddr2text(isa->src_mask, &mask1, 0))
@@ -412,8 +405,6 @@ ipsec_finalize_exchange(struct message *msg)
if (mask2)
free(mask2);
-#endif /* USE_DEBUG */
-
/*
* If this is not an SA acquired by the
* kernel, it needs to have a SPD entry
@@ -1183,7 +1174,6 @@ ipsec_is_attribute_incompatible(u_int16_t type, u_int8_t *value, u_int16_t len,
return 1;
}
-#ifdef USE_DEBUG
/*
* Log the attribute of TYPE with a LEN length value pointed to by VALUE
* in human-readable form. VMSG is a pointer to the current message.
@@ -1208,7 +1198,6 @@ ipsec_debug_attribute(u_int16_t type, u_int8_t *value, u_int16_t len,
ipsec_attr_cst, type), val));
return 0;
}
-#endif
/*
* Decode the attribute of type TYPE with a LEN length value pointed to by
diff --git a/sbin/isakmpd/isakmp_doi.c b/sbin/isakmpd/isakmp_doi.c
index b819f768a2c..ed24fce11bd 100644
--- a/sbin/isakmpd/isakmp_doi.c
+++ b/sbin/isakmpd/isakmp_doi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isakmp_doi.c,v 1.23 2005/04/08 16:52:41 deraadt Exp $ */
+/* $OpenBSD: isakmp_doi.c,v 1.24 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: isakmp_doi.c,v 1.42 2000/09/12 16:29:41 ho Exp $ */
/*
@@ -49,10 +49,8 @@
#include "sa.h"
#include "util.h"
-#ifdef USE_DEBUG
static int isakmp_debug_attribute(u_int16_t, u_int8_t *, u_int16_t,
void *);
-#endif
static void isakmp_finalize_exchange(struct message *);
static struct keystate *isakmp_get_keystate(struct message *);
static int isakmp_initiator(struct message *);
@@ -73,9 +71,7 @@ static int isakmp_validate_transform_id(u_int8_t, u_int8_t);
static struct doi isakmp_doi = {
{0}, ISAKMP_DOI_ISAKMP, 0, 0, 0,
-#ifdef USE_DEBUG
isakmp_debug_attribute,
-#endif
0, /* delete_spi not needed. */
0, /* exchange_script not needed. */
isakmp_finalize_exchange,
@@ -102,9 +98,7 @@ static struct doi isakmp_doi = {
isakmp_validate_transform_id,
isakmp_initiator,
isakmp_responder,
-#ifdef USE_DEBUG
ipsec_decode_ids
-#endif
};
/* Requires doi_init to already have been called. */
@@ -114,7 +108,6 @@ isakmp_doi_init(void)
doi_register(&isakmp_doi);
}
-#ifdef USE_DEBUG
int
isakmp_debug_attribute(u_int16_t type, u_int8_t *value, u_int16_t len,
void *vmsg)
@@ -122,7 +115,6 @@ isakmp_debug_attribute(u_int16_t type, u_int8_t *value, u_int16_t len,
/* XXX Not implemented yet. */
return 0;
}
-#endif /* USE_DEBUG */
static void
isakmp_finalize_exchange(struct message *msg)
diff --git a/sbin/isakmpd/isakmpd.c b/sbin/isakmpd/isakmpd.c
index bae5e549546..3b761076aa9 100644
--- a/sbin/isakmpd/isakmpd.c
+++ b/sbin/isakmpd/isakmpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isakmpd.c,v 1.82 2005/04/08 17:15:01 deraadt Exp $ */
+/* $OpenBSD: isakmpd.c,v 1.83 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: isakmpd.c,v 1.54 2000/10/05 09:28:22 niklas Exp $ */
/*
@@ -109,10 +109,8 @@ void daemon_shutdown_now(int);
/* The default path of the PID file. */
static char *pid_file = "/var/run/isakmpd.pid";
-#ifdef USE_DEBUG
/* The path of the IKE packet capture log file. */
static char *pcap_file = 0;
-#endif
static void
usage(void)
@@ -133,10 +131,8 @@ parse_args(int argc, char *argv[])
{
int ch;
char *ep;
-#ifdef USE_DEBUG
int cls, level;
int do_packetlog = 0;
-#endif
while ((ch = getopt(argc, argv, "46ac:dD:f:i:KnN:p:Ll:r:R:Tv")) != -1) {
switch (ch) {
@@ -160,7 +156,6 @@ parse_args(int argc, char *argv[])
debug++;
break;
-#ifdef USE_DEBUG
case 'D':
if (sscanf(optarg, "%d=%d", &cls, &level) != 2) {
if (sscanf(optarg, "A=%d", &level) == 1) {
@@ -173,7 +168,6 @@ parse_args(int argc, char *argv[])
} else
log_debug_cmd(cls, level);
break;
-#endif /* USE_DEBUG */
case 'f':
ui_fifo = optarg;
@@ -199,7 +193,6 @@ parse_args(int argc, char *argv[])
udp_default_port = optarg;
break;
-#ifdef USE_DEBUG
case 'l':
pcap_file = optarg;
/* Fallthrough intended. */
@@ -207,7 +200,6 @@ parse_args(int argc, char *argv[])
case 'L':
do_packetlog++;
break;
-#endif /* USE_DEBUG */
case 'r':
seed = strtoul(optarg, &ep, 0);
@@ -238,10 +230,8 @@ parse_args(int argc, char *argv[])
argc -= optind;
argv += optind;
-#ifdef USE_DEBUG
if (do_packetlog && !pcap_file)
pcap_file = PCAP_FILE_DEFAULT;
-#endif
}
static void
@@ -335,9 +325,7 @@ daemon_shutdown(void)
* the DELETE notifications have been sent, we can shutdown.
*/
-#ifdef USE_DEBUG
log_packet_stop();
-#endif
/* Remove FIFO and pid files. */
unlink(ui_fifo);
unlink(pid_file);
@@ -439,11 +427,9 @@ main(int argc, char *argv[])
/* Rehash soft expiration timers on USR2 reception. */
signal(SIGUSR2, sigusr2);
-#if defined (USE_DEBUG)
/* If we wanted IKE packet capture to file, initialize it now. */
if (pcap_file != 0)
log_packet_init(pcap_file);
-#endif
/* Allocate the file descriptor sets just big enough. */
n = getdtablesize();
diff --git a/sbin/isakmpd/log.c b/sbin/isakmpd/log.c
index fcde9f8f8de..8e17b1592e6 100644
--- a/sbin/isakmpd/log.c
+++ b/sbin/isakmpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.55 2005/04/08 16:37:14 deraadt Exp $ */
+/* $OpenBSD: log.c,v 1.56 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: log.c,v 1.30 2000/09/29 08:19:23 niklas Exp $ */
/*
@@ -33,7 +33,6 @@
#include <sys/types.h>
#include <sys/time.h>
-#ifdef USE_DEBUG
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/uio.h>
@@ -46,8 +45,6 @@
#include <pcap.h>
-#endif /* USE_DEBUG */
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -67,7 +64,6 @@ static void _log_print(int, int, const char *, va_list, int, int);
static FILE *log_output;
int verbose_logging = 0;
-#if defined (USE_DEBUG)
static int log_level[LOG_ENDCLASS];
#define TCPDUMP_MAGIC 0xa1b2c3d4
@@ -95,7 +91,6 @@ static u_int8_t *packet_buf = NULL;
static int udp_cksum(struct packhdr *, const struct udphdr *,
u_int16_t *);
static u_int16_t in_cksum(const u_int16_t *, int);
-#endif /* USE_DEBUG */
void
log_init(int debug)
@@ -110,17 +105,14 @@ void
log_reinit(void)
{
struct conf_list *logging;
-#ifdef USE_DEBUG
struct conf_list_node *logclass;
int class, level;
-#endif /* USE_DEBUG */
logging = conf_get_list("General", "Logverbose");
if (logging) {
verbose_logging = 1;
conf_free_list(logging);
}
-#ifdef USE_DEBUG
logging = conf_get_list("General", "Loglevel");
if (!logging)
return;
@@ -140,7 +132,6 @@ log_reinit(void)
log_debug_cmd(class, level);
}
conf_free_list(logging);
-#endif /* USE_DEBUG */
}
void
@@ -235,7 +226,6 @@ _log_print(int error, int syslog_level, const char *fmt, va_list ap,
buffer);
}
-#ifdef USE_DEBUG
void
log_debug(int cls, int level, const char *fmt, ...)
{
@@ -324,7 +314,6 @@ log_debug_toggle(void)
}
toggle = !toggle;
}
-#endif /* USE_DEBUG */
void
log_print(const char *fmt, ...)
@@ -340,18 +329,14 @@ void
log_verbose(const char *fmt, ...)
{
va_list ap;
-#ifdef USE_DEBUG
int i;
-#endif /* USE_DEBUG */
if (verbose_logging == 0)
return;
-#ifdef USE_DEBUG
for (i = 0; i < LOG_ENDCLASS; i++)
if (log_level[i] > 0)
return;
-#endif
va_start(ap, fmt);
_log_print(0, LOG_NOTICE, fmt, ap, LOG_PRINT, 0);
@@ -379,7 +364,6 @@ log_fatal(const char *fmt, ...)
monitor_exit(1);
}
-#ifdef USE_DEBUG
void
log_packet_init(char *newname)
{
@@ -691,5 +675,3 @@ in_cksum(const u_int16_t *w, int len)
answer = ~sum; /* truncate to 16 bits */
return answer;
}
-
-#endif /* USE_DEBUG */
diff --git a/sbin/isakmpd/log.h b/sbin/isakmpd/log.h
index dc36f5d144d..7c435896c63 100644
--- a/sbin/isakmpd/log.h
+++ b/sbin/isakmpd/log.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.h,v 1.21 2004/05/23 18:17:56 hshoexer Exp $ */
+/* $OpenBSD: log.h,v 1.22 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: log.h,v 1.19 2000/03/30 14:27:23 ho Exp $ */
/*
@@ -61,8 +61,6 @@ enum log_classes {
#define LOG_PRINT -1
#define LOG_REPORT -2
-#ifdef USE_DEBUG
-
#define LOG_DBG(x) log_debug x
#define LOG_DBG_BUF(x) log_debug_buf x
@@ -79,13 +77,6 @@ extern void log_packet_iov(struct sockaddr *, struct sockaddr *,
extern void log_packet_restart(char *);
extern void log_packet_stop(void);
-#else /* !USE_DEBUG */
-
-#define LOG_DBG(x)
-#define LOG_DBG_BUF(x)
-
-#endif /* USE_DEBUG */
-
extern FILE *log_current(void);
extern void log_error(const char *,...)
__attribute__((__format__(__printf__, 1, 2)));
diff --git a/sbin/isakmpd/message.c b/sbin/isakmpd/message.c
index 1ca73aaa607..5aa97e95ec1 100644
--- a/sbin/isakmpd/message.c
+++ b/sbin/isakmpd/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.104 2005/04/08 16:52:41 deraadt Exp $ */
+/* $OpenBSD: message.c,v 1.105 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: message.c,v 1.156 2000/10/10 12:36:39 provos Exp $ */
/*
@@ -413,11 +413,9 @@ message_parse_transform(struct message *msg, struct payload *p,
LOG_DBG((LOG_MESSAGE, 50, "Transform %d's attributes",
GET_ISAKMP_TRANSFORM_NO(buf)));
-#ifdef USE_DEBUG
attribute_map(buf + ISAKMP_TRANSFORM_SA_ATTRS_OFF,
GET_ISAKMP_GEN_LENGTH(buf) - ISAKMP_TRANSFORM_SA_ATTRS_OFF,
msg->exchange->doi->debug_attribute, msg);
-#endif
return 0;
}
@@ -1199,10 +1197,8 @@ message_recv(struct message *msg)
message_drop(msg, 0, 0, 1, 1);
return -1;
}
-#ifdef USE_DEBUG
/* Possibly dump a raw hex image of the message to the log channel. */
message_dump_raw("message_recv", msg, LOG_MESSAGE);
-#endif
/*
* If the responder cookie is zero, this is a request to setup an
@@ -1526,9 +1522,7 @@ message_send(struct message *msg)
GET_ISAKMP_HDR_FLAGS(msg->iov[0].iov_base)
| ISAKMP_FLAGS_COMMIT);
-#ifdef USE_DEBUG
message_dump_raw("message_send", msg, LOG_MESSAGE);
-#endif
msg->flags |= MSG_IN_TRANSIT;
exchange->in_transit = msg;
@@ -1888,7 +1882,6 @@ message_dump_raw(char *header, struct message *msg, int class)
static void
message_packet_log(struct message *msg)
{
-#if defined (USE_DEBUG)
struct sockaddr *src, *dst;
struct transport *t = msg->transport;
@@ -1910,7 +1903,6 @@ message_packet_log(struct message *msg)
}
log_packet_iov(src, dst, msg->iov, msg->iovlen);
-#endif /* USE_DEBUG */
}
/*
diff --git a/sbin/isakmpd/pf_key_v2.c b/sbin/isakmpd/pf_key_v2.c
index 993c4121d60..a94b536be81 100644
--- a/sbin/isakmpd/pf_key_v2.c
+++ b/sbin/isakmpd/pf_key_v2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_key_v2.c,v 1.162 2005/04/08 17:15:01 deraadt Exp $ */
+/* $OpenBSD: pf_key_v2.c,v 1.163 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: pf_key_v2.c,v 1.79 2000/12/12 00:33:19 niklas Exp $ */
/*
@@ -1044,9 +1044,7 @@ pf_key_v2_set_spi(struct sa *sa, struct proto *proto, int incoming,
struct sadb_protocol flowtype, tprotocol;
#endif
struct sadb_x_udpencap udpencap;
-#ifdef USE_DEBUG
char *addr_str;
-#endif
msg.sadb_msg_type = incoming ? SADB_UPDATE : SADB_ADD;
switch (proto->proto) {
@@ -1783,7 +1781,6 @@ doneauth:
/* XXX Here can sensitivity extensions be setup. */
-#ifdef USE_DEBUG
if (sockaddr2text(dst, &addr_str, 0))
addr_str = 0;
@@ -1793,7 +1790,6 @@ doneauth:
if (addr_str)
free(addr_str);
-#endif /* USE_DEBUG */
/*
* Although PF_KEY knows about expirations, it is unreliable per the
@@ -1876,9 +1872,7 @@ pf_key_v2_flow(struct sockaddr *laddr, struct sockaddr *lmask,
u_int8_t dstid_type, u_int8_t *dstid, int dstid_len,
struct ipsec_proto *iproto)
{
-#ifdef USE_DEBUG
char *laddr_str, *lmask_str, *raddr_str, *rmask_str;
-#endif
#if defined (SADB_X_ADDFLOW) && defined (SADB_X_DELFLOW)
struct sadb_msg msg;
@@ -2082,7 +2076,6 @@ pf_key_v2_flow(struct sockaddr *laddr, struct sockaddr *lmask,
if (pf_key_v2_msg_add(flow, (struct sadb_ext *)&tprotocol, 0) == -1)
goto cleanup;
-#ifdef USE_DEBUG
if (sockaddr2text(laddr, &laddr_str, 0))
laddr_str = 0;
if (sockaddr2text(lmask, &lmask_str, 0))
@@ -2106,7 +2099,6 @@ pf_key_v2_flow(struct sockaddr *laddr, struct sockaddr *lmask,
free(raddr_str);
if (rmask_str)
free(rmask_str);
-#endif /* USE_DEBUG */
ret = pf_key_v2_call(flow);
pf_key_v2_msg_free(flow);
@@ -2282,7 +2274,6 @@ cleanup:
goto cleanup;
policy = 0;
-#ifdef USE_DEBUG
if (sockaddr2text(laddr, &laddr_str, 0))
laddr_str = 0;
if (sockaddr2text(lmask, &lmask_str, 0))
@@ -2305,7 +2296,6 @@ cleanup:
free(raddr_str);
if (rmask_str)
free(rmask_str);
-#endif
ret = pf_key_v2_call(flow);
pf_key_v2_msg_free(flow);
@@ -2926,9 +2916,7 @@ pf_key_v2_expire(struct pf_key_v2_msg *pmsg)
struct sadb_lifetime *life, *lifecurrent;
struct sa *sa;
struct pf_key_v2_node *lifenode, *ext;
-#ifdef USE_DEBUG
char *dst_str;
-#endif
msg = (struct sadb_msg *)TAILQ_FIRST(pmsg)->seg;
ext = pf_key_v2_find_ext(pmsg, SADB_EXT_SA);
@@ -2962,8 +2950,6 @@ pf_key_v2_expire(struct pf_key_v2_msg *pmsg)
}
lifecurrent = lifenode->seg;
-#ifdef USE_DEBUG
-
if (sockaddr2text(dstaddr, &dst_str, 0))
dst_str = 0;
@@ -2976,8 +2962,6 @@ pf_key_v2_expire(struct pf_key_v2_msg *pmsg)
if (dst_str)
free(dst_str);
-#endif /* USE_DEBUG */
-
/*
* Find the IPsec SA. The IPsec stack has two SAs for every IKE SA,
* one outgoing and one incoming, we regard expirations for any of
diff --git a/sbin/isakmpd/ui.c b/sbin/isakmpd/ui.c
index 33fb7546f61..b16c02fca78 100644
--- a/sbin/isakmpd/ui.c
+++ b/sbin/isakmpd/ui.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ui.c,v 1.43 2005/04/04 19:31:11 deraadt Exp $ */
+/* $OpenBSD: ui.c,v 1.44 2005/04/08 19:40:03 deraadt Exp $ */
/* $EOM: ui.c,v 1.43 2000/10/05 09:25:12 niklas Exp $ */
/*
@@ -298,7 +298,6 @@ ui_delete(char *cmd)
sa_delete(sa, 1);
}
-#ifdef USE_DEBUG
/* Parse the debug command found in CMD. */
static void
ui_debug(char *cmd)
@@ -348,7 +347,6 @@ ui_packetlog(char *cmd)
fail:
log_print("ui_packetlog: command \"%s\" malformed", cmd);
}
-#endif /* USE_DEBUG */
static void
ui_shutdown_daemon(char *cmd)
@@ -409,7 +407,6 @@ ui_handle_command(char *line)
ui_delete(line);
break;
-#ifdef USE_DEBUG
case 'D':
ui_debug(line);
break;
@@ -417,7 +414,6 @@ ui_handle_command(char *line)
case 'p':
ui_packetlog(line);
break;
-#endif
case 'Q':
ui_shutdown_daemon(line);
diff --git a/sbin/isakmpd/virtual.c b/sbin/isakmpd/virtual.c
index 7a85ba4a17c..1a9847af92f 100644
--- a/sbin/isakmpd/virtual.c
+++ b/sbin/isakmpd/virtual.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: virtual.c,v 1.19 2005/04/08 16:37:15 deraadt Exp $ */
+/* $OpenBSD: virtual.c,v 1.20 2005/04/08 19:40:03 deraadt Exp $ */
/*
* Copyright (c) 2004 Håkan Olsson. All rights reserved.
@@ -332,7 +332,6 @@ virtual_bind_if(char *ifname, struct sockaddr *if_addr, void *arg)
char *addr_str;
int s, error;
-#if defined (USE_DEBUG)
if (sockaddr2text(if_addr, &addr_str, 0))
addr_str = 0;
@@ -344,7 +343,6 @@ virtual_bind_if(char *ifname, struct sockaddr *if_addr, void *arg)
addr_str ? addr_str : "<invalid>"));
if (addr_str)
free(addr_str);
-#endif
/*
* Drop non-Internet stuff.