summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-06-27 14:03:51 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-06-27 14:03:51 +0000
commitcfed5fd763aafb4328c76457911bdadccc31484a (patch)
tree422d08f7224936557433c43086b0bb3c1d8b89b5 /sbin/iked
parent3aae1be7bab7a6e66389e917d7e27178855ba222 (diff)
prevent an endless loop
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/ikev2_msg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/iked/ikev2_msg.c b/sbin/iked/ikev2_msg.c
index 622c6b2241b..f634377b7af 100644
--- a/sbin/iked/ikev2_msg.c
+++ b/sbin/iked/ikev2_msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ikev2_msg.c,v 1.18 2012/06/26 11:09:10 mikeb Exp $ */
+/* $OpenBSD: ikev2_msg.c,v 1.19 2012/06/27 14:03:50 mikeb Exp $ */
/* $vantronix: ikev2.c,v 1.101 2010/06/03 07:57:33 reyk Exp $ */
/*
@@ -891,9 +891,9 @@ void
ikev2_msg_prevail(struct iked *env, struct iked_msgqueue *queue,
struct iked_message *msg)
{
- struct iked_message *m = NULL;
+ struct iked_message *m, *mtmp;
- while ((m = TAILQ_FIRST(queue)) != NULL) {
+ TAILQ_FOREACH_SAFE(m, queue, msg_entry, mtmp) {
if (m->msg_msgid < msg->msg_msgid)
ikev2_msg_dispose(env, queue, m);
}