Skip to content

Commit 01f462f

Browse files
committed
ikev2: Ignore COOKIE notifies we already received
This could be due to a delayed response to an IKE_SA_INIT retransmit. Fixes #2837.
1 parent eed20c2 commit 01f462f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/libcharon/sa/ikev2/tasks/ike_init.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -890,6 +890,20 @@ METHOD(task_t, pre_process_i, status_t,
890890

891891
switch (type)
892892
{
893+
case COOKIE:
894+
{
895+
chunk_t cookie;
896+
897+
cookie = notify->get_notification_data(notify);
898+
if (chunk_equals(cookie, this->cookie))
899+
{
900+
DBG1(DBG_IKE, "ignore response with duplicate COOKIE "
901+
"notify");
902+
enumerator->destroy(enumerator);
903+
return FAILED;
904+
}
905+
break;
906+
}
893907
case REDIRECT:
894908
{
895909
identification_t *gateway;

0 commit comments

Comments
 (0)