aboutsummaryrefslogtreecommitdiffstats
path: root/Source/charon/threads/kernel_interface.c
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2006-04-10 08:07:38 +0000
committerMartin Willi <martin@strongswan.org>2006-04-10 08:07:38 +0000
commit5113680f95e522c677cdd37072cfffbdca06831e (patch)
tree973ac57accbc66b042e5307942c6cbbbf4f19579 /Source/charon/threads/kernel_interface.c
parent6862128151fb78f63685a8da5575783c426d64a7 (diff)
downloadstrongswan-5113680f95e522c677cdd37072cfffbdca06831e.tar.bz2
strongswan-5113680f95e522c677cdd37072cfffbdca06831e.tar.xz
- split up in libstrong, charon, stroke, testing done
- new leak detective with malloc hook in library - useable, but needs improvements - logger_manager has now a single instance per library - allows use of loggers from any linking prog - a LOT of other things
Diffstat (limited to 'Source/charon/threads/kernel_interface.c')
-rw-r--r--Source/charon/threads/kernel_interface.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/Source/charon/threads/kernel_interface.c b/Source/charon/threads/kernel_interface.c
index 87238d079..180ea55a5 100644
--- a/Source/charon/threads/kernel_interface.c
+++ b/Source/charon/threads/kernel_interface.c
@@ -35,7 +35,6 @@
#include "kernel_interface.h"
#include <daemon.h>
-#include <utils/allocator.h>
#include <utils/linked_list.h>
@@ -239,7 +238,7 @@ static status_t get_spi(private_kernel_interface_t *this,
}
*spi = response->sa.id.spi;
- allocator_free(response);
+ free(response);
return status;
}
@@ -329,7 +328,7 @@ static status_t add_sa( private_kernel_interface_t *this,
status = FAILED;
}
- allocator_free(response);
+ free(response);
return SUCCESS;
}
@@ -366,7 +365,7 @@ static status_t del_sa( private_kernel_interface_t *this,
status = FAILED;
}
- allocator_free(response);
+ free(response);
return SUCCESS;
}
@@ -458,7 +457,7 @@ static status_t add_policy(private_kernel_interface_t *this,
status = FAILED;
}
- allocator_free(response);
+ free(response);
return status;
}
@@ -506,7 +505,7 @@ static status_t del_policy(private_kernel_interface_t *this,
status = FAILED;
}
- allocator_free(response);
+ free(response);
return status;
}
@@ -623,7 +622,7 @@ static void receive_messages(private_kernel_interface_t *this)
else
{
/* add response to queue */
- listed_response = allocator_alloc(sizeof(response));
+ listed_response = malloc(sizeof(response));
memcpy(listed_response, &response, sizeof(response));
pthread_mutex_lock(&(this->mutex));
@@ -645,7 +644,7 @@ static void destroy(private_kernel_interface_t *this)
pthread_join(this->thread, NULL);
close(this->socket);
this->responses->destroy(this->responses);
- allocator_free(this);
+ free(this);
}
/*
@@ -653,7 +652,7 @@ static void destroy(private_kernel_interface_t *this)
*/
kernel_interface_t *kernel_interface_create()
{
- private_kernel_interface_t *this = allocator_alloc_thing(private_kernel_interface_t);
+ private_kernel_interface_t *this = malloc_thing(private_kernel_interface_t);
/* public functions */
this->public.get_spi = (status_t(*)(kernel_interface_t*,host_t*,host_t*,protocol_id_t,u_int32_t,u_int32_t*))get_spi;
@@ -675,17 +674,17 @@ kernel_interface_t *kernel_interface_create()
this->socket = socket(PF_NETLINK, SOCK_RAW, NETLINK_XFRM);
if (this->socket <= 0)
{
- allocator_free(this);
+ free(this);
charon->kill(charon, "Unable to create netlink socket");
}
if (pthread_create(&(this->thread), NULL, (void*(*)(void*))this->receive_messages, this) != 0)
{
close(this->socket);
- allocator_free(this);
+ free(this);
charon->kill(charon, "Unable to create netlink thread");
}
- charon->logger_manager->enable_log_level(charon->logger_manager, TESTER, FULL);
+ logger_manager->enable_log_level(logger_manager, TESTER, FULL);
return (&this->public);
}