Hi Heiko,

On 16-11-14 13:51, Heiko Hund wrote:
> Please review and comment.

This morning I finally found some time to set up a windows build
environment to cross-compile the windows builds from linux. I'm trying
to find more time to really review and test. For now just some
preliminary stuff I came across:

(1) open_tun(), close_tun(), etc :
Instead of passing the options struct, consider just passing the
msg_channel. That would require it to be something more generic than
HANDLE, but I think this model makes sense for other platforms too.

(2) includes: you should include "openvpn-msg.h", instead of
"include/openvpn-msg.h" (that's how it's done for openvpn-plugin.h too):

openvpn/src/openvpn/route.c:48:33: fatal error: include/openvpn-msg.h:
No such file or directory
 #include "include/openvpn-msg.h"

Attached a patch with the changes I had to make.

(3) mingw/GCC has a warning for me:

openvpn/src/openvpnserv/interactive.c:708:11: warning: enumeration value
‘_undo_type_max’ not handled in switch [-Wswitch]
           switch (type)
           ^

For others: if you have Windows build and test setups, please help out.
Especially Windows users willing to test are welcome. This feature
deserves more attention :)

-Steffan
From 1fa191c9edfdef1b22dc04b789162a275cc507ef Mon Sep 17 00:00:00 2001
From: Steffan Karger <stef...@karger.me>
List-Post: openvpn-devel@lists.sourceforge.net
Date: Sun, 14 Dec 2014 14:12:42 +0100
Subject: [PATCH] Fix openvpn-msg.h includes

Signed-off-by: Steffan Karger <stef...@karger.me>
---
 src/openvpn/route.c           | 2 +-
 src/openvpn/tun.c             | 2 +-
 src/openvpnserv/Makefile.am   | 3 +++
 src/openvpnserv/interactive.c | 2 +-
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/openvpn/route.c b/src/openvpn/route.c
index 6d7e8e2..55ab11e 100644
--- a/src/openvpn/route.c
+++ b/src/openvpn/route.c
@@ -45,7 +45,7 @@
 
 #include "memdbg.h"
 
-#include "include/openvpn-msg.h"
+#include "openvpn-msg.h"
 
 #ifdef WIN32
 #define METRIC_NOT_USED ((DWORD)-1)
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 9b2fa1a..0b629fa 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -50,7 +50,7 @@
 
 #include "memdbg.h"
 
-#include "include/openvpn-msg.h"
+#include "openvpn-msg.h"
 
 #include <string.h>
 
diff --git a/src/openvpnserv/Makefile.am b/src/openvpnserv/Makefile.am
index 6088287..4bb1c27 100644
--- a/src/openvpnserv/Makefile.am
+++ b/src/openvpnserv/Makefile.am
@@ -17,6 +17,9 @@ EXTRA_DIST = \
 	openvpnserv.vcxproj \
 	openvpnserv.vcxproj.filters
 
+AM_CPPFLAGS = \
+	-I$(top_srcdir)/include
+
 if WIN32
 sbin_PROGRAMS = openvpnserv
 openvpnserv_CFLAGS = \
diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 368450b..0040d85 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -34,7 +34,7 @@
 #include <stdio.h>
 #include <sddl.h>
 
-#include "include/openvpn-msg.h"
+#include "openvpn-msg.h"
 
 #define IO_TIMEOUT  2000 /*ms*/
 
-- 
1.9.1

Reply via email to