diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-27 21:10:15 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1999-04-27 21:10:15 +0000 |
commit | ea156eae0177106298172fc315bb8fe603be8a7f (patch) | |
tree | d1d92ca6b0096158a13e4727cd3ce4a808d8cbe7 /sbin/isakmpd/message.c | |
parent | 805608b3c377ab3f59f28e6d255ec4e6ebef4559 (diff) |
Merge with EOM 1.124
author: niklas
When seeing duplicates, just retransmit if the last sent
message was the last of an exchange, thus not scheduled for retransmission.
author: ho
Keep track of trailing retransmissions by keeping exchanges around longer.
Removed references to sa->last_sent_in_setup, use last_sent and
last_received in exchange instead. Free setup exchanges by expiration only.
author: ho
Backout last change. (Go with exchange directly instead of sa->msg)
author: ho
Handle phase 2 late retransmissions.
Diffstat (limited to 'sbin/isakmpd/message.c')
-rw-r--r-- | sbin/isakmpd/message.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sbin/isakmpd/message.c b/sbin/isakmpd/message.c index d48ad1eaf70..cddcb1f3fbd 100644 --- a/sbin/isakmpd/message.c +++ b/sbin/isakmpd/message.c @@ -1,5 +1,5 @@ -/* $OpenBSD: message.c,v 1.15 1999/04/19 20:59:27 niklas Exp $ */ -/* $EOM: message.c,v 1.120 1999/04/17 23:20:41 niklas Exp $ */ +/* $OpenBSD: message.c,v 1.16 1999/04/27 21:10:14 niklas Exp $ */ +/* $EOM: message.c,v 1.124 1999/04/27 18:44:37 niklas Exp $ */ /* * Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved. @@ -958,20 +958,14 @@ message_recv (struct message *msg) if (!msg->exchange) { log_print ("message_recv: phase 1 message after ISAKMP SA is ready"); - - /* - * Retransmit final message of the exchange that set up the - * ISAKMP SA. - */ - if (msg->isakmp_sa->last_sent_in_setup) - { - log_debug (LOG_MESSAGE, 80, - "message_recv: resending last message from phase 1"); - message_send (msg->isakmp_sa->last_sent_in_setup); - } - return -1; } + else if (msg->exchange->last_sent) + { + log_debug (LOG_MESSAGE, 80, + "message_recv: resending last message from phase 1"); + message_send (msg->exchange->last_sent); + } } if (flags & ISAKMP_FLAGS_ENC) @@ -1438,7 +1432,13 @@ message_check_duplicate (struct message *msg) && memcmp (pkt, exchange->last_received->orig, sz) == 0) { log_debug (LOG_MESSAGE, 80, "message_check_duplicate: dropping dup"); - /* XXX Should we do an early retransmit of our last message? */ + + /* + * Retransmit if the previos sent message was the last of an + * exchange, otherwise just wait for the ordinary retransmission. + */ + if (exchange->last_sent->flags & MSG_LAST) + message_send (exchange->last_sent); message_free (msg); return -1; } |