aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/socket_raw/socket_raw_socket.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2010-10-15 17:24:23 +0200
committerTobias Brunner <tobias@strongswan.org>2010-10-15 17:30:21 +0200
commitfa208494319efd0bc48fa63bfff9dac9bef84a55 (patch)
treecd20dae44e8f03eec2d505400830db0b84a7d656 /src/libcharon/plugins/socket_raw/socket_raw_socket.c
parent4de8398f931e1777c685710c87ad412bcf6715c4 (diff)
downloadstrongswan-fa208494319efd0bc48fa63bfff9dac9bef84a55.tar.bz2
strongswan-fa208494319efd0bc48fa63bfff9dac9bef84a55.tar.xz
Deferred instantiation of socket implmentations until registration.
Instantiating the implementations on plugin load was problematic in case multiple socket plugins were loaded. Now, the first one registered is instantiated.
Diffstat (limited to 'src/libcharon/plugins/socket_raw/socket_raw_socket.c')
-rw-r--r--src/libcharon/plugins/socket_raw/socket_raw_socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcharon/plugins/socket_raw/socket_raw_socket.c b/src/libcharon/plugins/socket_raw/socket_raw_socket.c
index 66bc78526..f6e87a86f 100644
--- a/src/libcharon/plugins/socket_raw/socket_raw_socket.c
+++ b/src/libcharon/plugins/socket_raw/socket_raw_socket.c
@@ -1,6 +1,7 @@
/*
- * Copyright (C) 2006 Tobias Brunner, Daniel Roethlisberger
+ * Copyright (C) 2006-2010 Tobias Brunner
* Copyright (C) 2005-2010 Martin Willi
+ * Copyright (C) 2006 Daniel Roethlisberger
* Copyright (C) 2005 Jan Hutter
* Hochschule fuer Technik Rapperswil
*
@@ -612,7 +613,7 @@ static int open_recv_socket(private_socket_raw_socket_t *this, int family)
return skt;
}
-METHOD(socket_raw_socket_t, destroy, void,
+METHOD(socket_t, destroy, void,
private_socket_raw_socket_t *this)
{
if (this->recv4)
@@ -654,8 +655,8 @@ socket_raw_socket_t *socket_raw_socket_create()
.socket = {
.send = _sender,
.receive = _receiver,
+ .destroy = _destroy,
},
- .destroy = _destroy,
},
.max_packet = lib->settings->get_int(lib->settings,
"charon.max_packet", MAX_PACKET),