ikev1: Don't log a reauthentication detection message if no children adopted
authorMartin Willi <martin@revosec.ch>
Wed, 18 Sep 2013 11:59:44 +0000 (13:59 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 30 Sep 2013 11:51:11 +0000 (13:51 +0200)
When a replace unique policy is in place, the children get adopted during
the uniqueness check. In this case the message is just misleading.

src/libcharon/processing/jobs/adopt_children_job.c

index df5b70c..f99c0b9 100644 (file)
@@ -102,8 +102,12 @@ METHOD(job_t, execute, job_requeue_t,
                                                children->insert_last(children, child_sa);
                                        }
                                        childenum->destroy(childenum);
-                                       DBG1(DBG_IKE, "detected reauth of existing IKE_SA, "
-                                                "adopting %d children", children->get_count(children));
+                                       if (children->get_count(children))
+                                       {
+                                               DBG1(DBG_IKE, "detected reauth of existing IKE_SA, "
+                                                        "adopting %d children",
+                                                        children->get_count(children));
+                                       }
                                        ike_sa->set_state(ike_sa, IKE_DELETING);
                                        charon->bus->ike_updown(charon->bus, ike_sa, FALSE);
                                        charon->ike_sa_manager->checkin_and_destroy(