fixed a at-least-one-year-old bug which caused crashed in the scheduler
authorMartin Willi <martin@strongswan.org>
Thu, 31 Aug 2006 06:48:10 +0000 (06:48 -0000)
committerMartin Willi <martin@strongswan.org>
Thu, 31 Aug 2006 06:48:10 +0000 (06:48 -0000)
src/charon/doc/Todo-list.txt
src/charon/sa/transactions/ike_sa_init.c
src/charon/threads/scheduler.c

index b8d2240..10cd2f9 100644 (file)
@@ -67,3 +67,5 @@
   when a blocked IKE_SA receives a lot of messages
 - add a crl fetch mechanism which synchronizes equal fetches
 - add support for CERTREQs
   when a blocked IKE_SA receives a lot of messages
 - add a crl fetch mechanism which synchronizes equal fetches
 - add support for CERTREQs
+- use same reqid for routed connections when they are set up
+- add firewall script support
index 5b200f6..fed03fa 100644 (file)
@@ -212,7 +212,7 @@ static chunk_t generate_natd_hash(private_ike_sa_init_t *this,
        spi_i_chunk.len = sizeof(spi_i);
        spi_r_chunk.ptr = (void*)&spi_r;
        spi_r_chunk.len = sizeof(spi_r);
        spi_i_chunk.len = sizeof(spi_i);
        spi_r_chunk.ptr = (void*)&spi_r;
        spi_r_chunk.len = sizeof(spi_r);
-       port = host->get_port(host);
+       port = htons(host->get_port(host));
        port_chunk.ptr = (void*)&port;
        port_chunk.len = sizeof(port);
        addr_chunk = host->get_address(host);
        port_chunk.ptr = (void*)&port;
        port_chunk.len = sizeof(port);
        addr_chunk = host->get_address(host);
index d3013cb..ba86c1b 100644 (file)
@@ -68,13 +68,13 @@ static void get_events(private_scheduler_t * this)
 
        while (TRUE)
        {
 
        while (TRUE)
        {
-               this->logger->log(this->logger, CONTROL|LEVEL2, "Waiting for next event...");
+               this->logger->log(this->logger, CONTROL|LEVEL2, "waiting for next event...");
                /* get a job, this block until one is available */
                current_job = charon->event_queue->get(charon->event_queue);
                /* queue the job in the job queue, workers will eat them */
                /* get a job, this block until one is available */
                current_job = charon->event_queue->get(charon->event_queue);
                /* queue the job in the job queue, workers will eat them */
-               charon->job_queue->add(charon->job_queue, current_job);
-               this->logger->log(this->logger, CONTROL | LEVEL1, "Got event, added job %s to job-queue.", 
+               this->logger->log(this->logger, CONTROL | LEVEL1, "got event, adding job %s to job-queue.", 
                                                  mapping_find(job_type_m, current_job->get_type(current_job)));
                                                  mapping_find(job_type_m, current_job->get_type(current_job)));
+               charon->job_queue->add(charon->job_queue, current_job);
        }
 }
 
        }
 }
 
@@ -83,11 +83,11 @@ static void get_events(private_scheduler_t * this)
  */
 static void destroy(private_scheduler_t *this)
 {
  */
 static void destroy(private_scheduler_t *this)
 {
-       this->logger->log(this->logger, CONTROL | LEVEL1, "Going to terminate scheduler thread");
+       this->logger->log(this->logger, CONTROL | LEVEL1, "going to terminate scheduler thread");
        pthread_cancel(this->assigned_thread);
 
        pthread_join(this->assigned_thread, NULL);
        pthread_cancel(this->assigned_thread);
 
        pthread_join(this->assigned_thread, NULL);
-       this->logger->log(this->logger, CONTROL | LEVEL1, "Scheduler thread terminated");
+       this->logger->log(this->logger, CONTROL | LEVEL1, "scheduler thread terminated");
 
        free(this);
 }
 
        free(this);
 }
@@ -106,9 +106,9 @@ scheduler_t * scheduler_create()
        if (pthread_create(&(this->assigned_thread), NULL, (void*(*)(void*))get_events, this) != 0)
        {
                /* thread could not be created  */
        if (pthread_create(&(this->assigned_thread), NULL, (void*(*)(void*))get_events, this) != 0)
        {
                /* thread could not be created  */
-               this->logger->log(this->logger, ERROR, "Scheduler thread could not be created!");
+               this->logger->log(this->logger, ERROR, "scheduler thread could not be created!");
                free(this);
                free(this);
-               charon->kill(charon, "Unable to create scheduler thread");
+               charon->kill(charon, "unable to create scheduler thread");
        }
 
        return &(this->public);
        }
 
        return &(this->public);