diff options
author | Martin Willi <martin@strongswan.org> | 2006-08-31 06:48:10 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2006-08-31 06:48:10 +0000 |
commit | da8ab11e918353293953636abea73f12bf8f956e (patch) | |
tree | a03b1118bf3e6a940523ed4ced4d2c2847f03328 | |
parent | c705698293f398cd94f6145f970cf0793ef45c05 (diff) | |
download | strongswan-da8ab11e918353293953636abea73f12bf8f956e.tar.bz2 strongswan-da8ab11e918353293953636abea73f12bf8f956e.tar.xz |
fixed a at-least-one-year-old bug which caused crashed in the scheduler
-rw-r--r-- | src/charon/doc/Todo-list.txt | 2 | ||||
-rw-r--r-- | src/charon/sa/transactions/ike_sa_init.c | 2 | ||||
-rw-r--r-- | src/charon/threads/scheduler.c | 14 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/charon/doc/Todo-list.txt b/src/charon/doc/Todo-list.txt index b8d2240e9..10cd2f930 100644 --- a/src/charon/doc/Todo-list.txt +++ b/src/charon/doc/Todo-list.txt @@ -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 +- use same reqid for routed connections when they are set up +- add firewall script support diff --git a/src/charon/sa/transactions/ike_sa_init.c b/src/charon/sa/transactions/ike_sa_init.c index 5b200f607..fed03fa49 100644 --- a/src/charon/sa/transactions/ike_sa_init.c +++ b/src/charon/sa/transactions/ike_sa_init.c @@ -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); - 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); diff --git a/src/charon/threads/scheduler.c b/src/charon/threads/scheduler.c index d3013cb95..ba86c1b43 100644 --- a/src/charon/threads/scheduler.c +++ b/src/charon/threads/scheduler.c @@ -68,13 +68,13 @@ static void get_events(private_scheduler_t * this) 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 */ - 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))); + 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) { - 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); - this->logger->log(this->logger, CONTROL | LEVEL1, "Scheduler thread terminated"); + this->logger->log(this->logger, CONTROL | LEVEL1, "scheduler thread terminated"); 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 */ - 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); - charon->kill(charon, "Unable to create scheduler thread"); + charon->kill(charon, "unable to create scheduler thread"); } return &(this->public); |