aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/network/socket-raw.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2009-12-17 15:58:12 +0100
committerTobias Brunner <tobias@strongswan.org>2009-12-23 17:03:41 +0100
commit4a5a5dd2900ed3b58381854e2c04ef23cd105645 (patch)
tree7f6b58cb8e1959731f8cb22746064ad2659260c3 /src/charon/network/socket-raw.c
parentc48eea920334488eb4fcc208cc0ba68b6989c045 (diff)
downloadstrongswan-4a5a5dd2900ed3b58381854e2c04ef23cd105645.tar.bz2
strongswan-4a5a5dd2900ed3b58381854e2c04ef23cd105645.tar.xz
Using the thread wrapper in charon, libstrongswan and their plugins.
Diffstat (limited to 'src/charon/network/socket-raw.c')
-rw-r--r--src/charon/network/socket-raw.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/charon/network/socket-raw.c b/src/charon/network/socket-raw.c
index 18b31d637..6cc0463b2 100644
--- a/src/charon/network/socket-raw.c
+++ b/src/charon/network/socket-raw.c
@@ -18,7 +18,6 @@
/* for struct in6_pktinfo */
#define _GNU_SOURCE
-#include <pthread.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
@@ -38,6 +37,7 @@
#include "socket.h"
#include <daemon.h>
+#include <threading/thread.h>
/* constants for packet handling */
#define IP_LEN sizeof(struct iphdr)
@@ -127,8 +127,8 @@ static status_t receiver(private_socket_t *this, packet_t **packet)
packet_t *pkt;
struct udphdr *udp;
host_t *source = NULL, *dest = NULL;
- int bytes_read = 0;
- int data_offset, oldstate;
+ int bytes_read = 0, data_offset;
+ bool oldstate;
fd_set rfds;
FD_ZERO(&rfds);
@@ -144,13 +144,13 @@ static status_t receiver(private_socket_t *this, packet_t **packet)
DBG2(DBG_NET, "waiting for data on raw sockets");
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldstate);
+ oldstate = thread_cancelability(TRUE);
if (select(max(this->recv4, this->recv6) + 1, &rfds, NULL, NULL, NULL) <= 0)
{
- pthread_setcancelstate(oldstate, NULL);
+ thread_cancelability(oldstate);
return FAILED;
}
- pthread_setcancelstate(oldstate, NULL);
+ thread_cancelability(oldstate);
if (this->recv4 && FD_ISSET(this->recv4, &rfds))
{