summaryrefslogtreecommitdiff
path: root/sbin/isakmpd
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2000-10-10 13:35:13 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2000-10-10 13:35:13 +0000
commit8349d7c4d53a85cb5803ca8574a042133cfcf690 (patch)
tree7d87ca736b9695b6e8867684ed5bb139f9e62956 /sbin/isakmpd
parent849d225f84b10a7fb8e45db13377e0444c601341 (diff)
message.c: Merge with EOM 1.156
message.h: Merge with EOM 1.51 transport.c: Merge with EOM 1.43 author: provos use message_send_expire for timeouts. okay niklas@
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r--sbin/isakmpd/message.c23
-rw-r--r--sbin/isakmpd/message.h5
-rw-r--r--sbin/isakmpd/transport.c8
3 files changed, 25 insertions, 11 deletions
diff --git a/sbin/isakmpd/message.c b/sbin/isakmpd/message.c
index 3b72bc01dd2..33f82d59c2a 100644
--- a/sbin/isakmpd/message.c
+++ b/sbin/isakmpd/message.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: message.c,v 1.33 2000/10/07 07:00:20 niklas Exp $ */
-/* $EOM: message.c,v 1.155 2000/10/06 23:55:42 niklas Exp $ */
+/* $OpenBSD: message.c,v 1.34 2000/10/10 13:35:11 niklas Exp $ */
+/* $EOM: message.c,v 1.156 2000/10/10 12:36:39 provos Exp $ */
/*
* Copyright (c) 1998, 1999, 2000 Niklas Hallqvist. All rights reserved.
@@ -270,7 +270,8 @@ message_parse_payloads (struct message *msg, struct payload *p, u_int8_t next,
/* Reserved fields in ISAKMP messages should be zero. */
if (GET_ISAKMP_GEN_RESERVED (buf) != 0)
{
- log_print ("message_parse_payloads: reserved field non-zero");
+ log_print ("message_parse_payloads: reserved field non-zero: %x",
+ GET_ISAKMP_GEN_RESERVED (buf));
message_drop (msg, ISAKMP_NOTIFY_PAYLOAD_MALFORMED, 0, 1, 1);
return -1;
}
@@ -1131,14 +1132,26 @@ message_recv (struct message *msg)
return 0;
}
+void
+message_send_expire (struct message *msg)
+{
+ msg->retrans = 0;
+
+ message_send (msg);
+}
+
/* Queue up message MSG for transmittal. */
void
message_send (struct message *msg)
{
struct exchange *exchange = msg->exchange;
- /* Reset the retransmission event. */
- msg->retrans = 0;
+ /* Remove retransmissions on this message */
+ if (msg->retrans)
+ {
+ timer_remove_event (msg->retrans);
+ msg->retrans = 0;
+ }
/*
* If the ISAKMP SA has set up encryption, encrypt the message.
diff --git a/sbin/isakmpd/message.h b/sbin/isakmpd/message.h
index d4b18c2d255..67cd3ebe93e 100644
--- a/sbin/isakmpd/message.h
+++ b/sbin/isakmpd/message.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: message.h,v 1.13 2000/10/07 06:57:00 niklas Exp $ */
-/* $EOM: message.h,v 1.50 2000/10/05 09:09:55 niklas Exp $ */
+/* $OpenBSD: message.h,v 1.14 2000/10/10 13:35:12 niklas Exp $ */
+/* $EOM: message.h,v 1.51 2000/10/10 12:36:39 provos Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
@@ -178,6 +178,7 @@ extern int message_register_post_send (struct message *,
void (*) (struct message *));
extern void message_post_send (struct message *);
extern void message_send (struct message *);
+extern void message_send_expire (struct message *);
extern void message_send_delete (struct sa *);
extern int message_send_info (struct message *);
extern void message_send_notification (struct message *, struct sa *,
diff --git a/sbin/isakmpd/transport.c b/sbin/isakmpd/transport.c
index 9d7dbb806ed..31341145ec6 100644
--- a/sbin/isakmpd/transport.c
+++ b/sbin/isakmpd/transport.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: transport.c,v 1.11 2000/10/07 06:57:34 niklas Exp $ */
-/* $EOM: transport.c,v 1.42 2000/09/14 18:12:55 provos Exp $ */
+/* $OpenBSD: transport.c,v 1.12 2000/10/10 13:35:12 niklas Exp $ */
+/* $EOM: transport.c,v 1.43 2000/10/10 12:36:39 provos Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
@@ -279,8 +279,8 @@ transport_send_messages (fd_set *fds)
if (msg->retrans)
timer_remove_event (msg->retrans);
msg->retrans
- = timer_add_event ("message_send",
- (void (*) (void *))message_send,
+ = timer_add_event ("message_send_expire",
+ (void (*) (void *))message_send_expire,
msg, &expiration);
/* If we cannot retransmit, we cannot... */
exchange->last_sent = msg->retrans ? msg : 0;