@@ -370,8 +370,8 @@ END_TEST
370370
371371/**
372372 * Check that the responder handles hard expires properly while waiting for the
373- * delete after a rekeying (e.g. if the initiator of the rekeying fails to
374- * delete the CHILD_SA for some reason ).
373+ * delete after a rekeying (e.g. if the rekey settings are tight or the
374+ * CREATE_CHILD_SA response is delayed ).
375375 */
376376START_TEST (test_regular_responder_handle_hard_expire )
377377{
@@ -405,28 +405,22 @@ START_TEST(test_regular_responder_handle_hard_expire)
405405
406406 /* we don't expect this to get called anymore */
407407 assert_hook_not_called (child_rekey );
408- /* this is similar to a regular delete collision */
409- assert_single_payload (OUT , PLV2_DELETE );
408+ /* this is similar to a regular delete collision, but we don't actually
409+ * want to send a delete back as that might conflict with a delayed
410+ * CREATE_CHILD_SA response */
410411 call_ikesa (b , delete_child_sa , PROTO_ESP , 2 , TRUE);
411- assert_child_sa_state (b , 2 , CHILD_DELETING , CHILD_OUTBOUND_INSTALLED );
412- assert_child_sa_state (b , 4 , CHILD_INSTALLED , CHILD_OUTBOUND_REGISTERED );
413- /* since the SAs expired they would not actually be installed in the kernel
414- * anymore and since we have not yet installed a new outbound SA this
415- * will result in dropped packets and possibly acquires */
416- assert_ipsec_sas_installed (b , 1 , 2 , 4 );
412+ assert_child_sa_count (b , 1 );
413+ assert_child_sa_state (b , 4 , CHILD_INSTALLED , CHILD_OUTBOUND_INSTALLED );
414+ /* the expire causes the outbound SA to get installed */
415+ assert_ipsec_sas_installed (b , 3 , 4 );
417416
418417 /* INFORMATIONAL { D } --> */
418+ assert_no_jobs_scheduled ();
419419 assert_single_payload (IN , PLV2_DELETE );
420420 exchange_test_helper -> process_message (exchange_test_helper , b , NULL );
421- assert_child_sa_state (b , 2 , CHILD_DELETING , CHILD_OUTBOUND_INSTALLED );
422- assert_child_sa_state (b , 4 , CHILD_INSTALLED , CHILD_OUTBOUND_REGISTERED );
423- assert_ipsec_sas_installed (b , 1 , 2 , 4 );
424- /* <-- INFORMATIONAL { D } */
425- assert_single_payload (IN , PLV2_DELETE );
426- exchange_test_helper -> process_message (exchange_test_helper , a , NULL );
427- assert_child_sa_state (a , 1 , CHILD_DELETING , CHILD_OUTBOUND_INSTALLED );
428- assert_child_sa_state (a , 3 , CHILD_INSTALLED , CHILD_OUTBOUND_INSTALLED );
429- assert_ipsec_sas_installed (a , 1 , 2 , 3 , 4 );
421+ assert_child_sa_state (b , 4 , CHILD_INSTALLED , CHILD_OUTBOUND_INSTALLED );
422+ assert_ipsec_sas_installed (b , 3 , 4 );
423+ assert_scheduler ();
430424 /* <-- INFORMATIONAL { } */
431425 assert_jobs_scheduled (1 );
432426 assert_message_empty (IN );
@@ -436,23 +430,11 @@ START_TEST(test_regular_responder_handle_hard_expire)
436430 assert_child_sa_count (a , 2 );
437431 assert_ipsec_sas_installed (a , 1 , 3 , 4 );
438432 assert_scheduler ();
439- /* INFORMATIONAL { } --> */
440- assert_jobs_scheduled (1 );
441- assert_message_empty (IN );
442- exchange_test_helper -> process_message (exchange_test_helper , b , NULL );
443- assert_child_sa_state (b , 2 , CHILD_DELETED , CHILD_OUTBOUND_NONE );
444- assert_child_sa_state (b , 4 , CHILD_INSTALLED , CHILD_OUTBOUND_INSTALLED );
445- assert_child_sa_count (b , 2 );
446- assert_ipsec_sas_installed (b , 2 , 3 , 4 );
447- assert_scheduler ();
448433
449- /* simulate the execution of the scheduled jobs */
434+ /* simulate the execution of the scheduled job */
450435 destroy_rekeyed (a , 1 );
451436 assert_child_sa_count (a , 1 );
452437 assert_ipsec_sas_installed (a , 3 , 4 );
453- destroy_rekeyed (b , 2 );
454- assert_child_sa_count (b , 1 );
455- assert_ipsec_sas_installed (b , 3 , 4 );
456438
457439 /* child_rekey/child_updown */
458440 assert_hook ();
0 commit comments