aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/kernel_iph/kernel_iph_net.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2014-06-06 16:32:31 +0200
committerMartin Willi <martin@revosec.ch>2014-06-06 16:33:50 +0200
commit4f31b3f7243d4d368ac88bda6af477e542d77aae (patch)
tree1e931ba67796aece980de91caa301cb2ae196ed6 /src/libcharon/plugins/kernel_iph/kernel_iph_net.c
parent9d228ddb04b7adc7c5904b98bc7857b12176904a (diff)
parentfd372e13a238180102168770ff8e60c82ba59da2 (diff)
downloadstrongswan-4f31b3f7243d4d368ac88bda6af477e542d77aae.tar.bz2
strongswan-4f31b3f7243d4d368ac88bda6af477e542d77aae.tar.xz
Merge branch 'win-32bit'
Fixes some issues when building 32-bit Windows binaries. Mostly related to the call API. Introduces a Travis 32-bit Windows build variant.
Diffstat (limited to 'src/libcharon/plugins/kernel_iph/kernel_iph_net.c')
-rw-r--r--src/libcharon/plugins/kernel_iph/kernel_iph_net.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/libcharon/plugins/kernel_iph/kernel_iph_net.c b/src/libcharon/plugins/kernel_iph/kernel_iph_net.c
index 68b753792..871067b1a 100644
--- a/src/libcharon/plugins/kernel_iph/kernel_iph_net.c
+++ b/src/libcharon/plugins/kernel_iph/kernel_iph_net.c
@@ -355,9 +355,11 @@ typedef struct {
/**
* NotifyIpInterfaceChange() callback
*/
-static void change_interface(private_kernel_iph_net_t *this,
- MIB_IPINTERFACE_ROW_FIXUP *row, MIB_NOTIFICATION_TYPE type)
+static void WINAPI change_interface(void *user, PMIB_IPINTERFACE_ROW row_badal,
+ MIB_NOTIFICATION_TYPE type)
{
+ private_kernel_iph_net_t *this = user;
+ MIB_IPINTERFACE_ROW_FIXUP* row = (MIB_IPINTERFACE_ROW_FIXUP*)row_badal;
IP_ADAPTER_ADDRESSES addrs[64], *current;
ULONG res, size = sizeof(addrs);
@@ -757,7 +759,8 @@ kernel_iph_net_t *kernel_iph_net_create()
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
.ifaces = linked_list_create(),
);
-
+ /* PIPINTERFACE_CHANGE_CALLBACK is not using WINAPI in MinGW, which seems
+ * to be wrong. Force a cast to our WINAPI call */
res = NotifyIpInterfaceChange(AF_UNSPEC, (void*)change_interface,
this, TRUE, &this->changes);
if (res != NO_ERROR)