]> git.ipfire.org Git - thirdparty/openvpn.git/log
thirdparty/openvpn.git
13 years agoEnsure sys/un.h autoconf detection includes sys/socket.h
Adriaan de Jong [Thu, 12 Apr 2012 06:50:12 +0000 (08:50 +0200)] 
Ensure sys/un.h autoconf detection includes sys/socket.h

This is required to build an Android binary.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Alon Bar-Lev <alon.barlev@gmail.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: remove C++ comments
Alon Bar-Lev [Sat, 7 Apr 2012 17:42:27 +0000 (20:42 +0300)] 
cleanup: remove C++ comments

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Fabian Knittel <fabian.knittel@lettink.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: plugin: support C++ plugin
Alon Bar-Lev [Sat, 7 Apr 2012 17:40:40 +0000 (20:40 +0300)] 
cleanup: plugin: support C++ plugin

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Fabian Knittel <fabian.knittel@lettink.de>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: properly detect TUNSETPERSIST
Alon Bar-Lev [Sun, 8 Apr 2012 19:21:47 +0000 (22:21 +0300)] 
build: properly detect TUNSETPERSIST

Do not rely on system symbol throught sources
but on autoconf detection.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: properly detect netinet/ip.h structs
Alon Bar-Lev [Sun, 8 Apr 2012 19:22:09 +0000 (22:22 +0300)] 
build: properly detect netinet/ip.h structs

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: fix some statement left from conversion
Alon Bar-Lev [Sat, 7 Apr 2012 17:39:26 +0000 (20:39 +0300)] 
build: fix some statement left from conversion

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: gc usage
Alon Bar-Lev [Sun, 1 Apr 2012 13:46:28 +0000 (16:46 +0300)] 
cleanup: gc usage

Cleanup of "Use the garbage collector when retrieving x509 fields"
patch series.

Discussed at [1].

There should be an effort to produce common function prologue
and epilogue, so that cleanups will be done at single point.

[1] http://comments.gmane.org/gmane.network.openvpn.devel/5401

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - windows
Alon Bar-Lev [Sun, 1 Apr 2012 12:12:37 +0000 (15:12 +0300)] 
cleanup: avoid using ~0 - windows

Use the following constants:
- METRIC_NOT_USED
- TUN_ADAPTER_INDEX_INVALID

Modified: Use MAXDWORD for route loop.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - netmask
Alon Bar-Lev [Thu, 29 Mar 2012 09:16:41 +0000 (11:16 +0200)] 
cleanup: avoid using ~0 - netmask

Use IPV4_NETMASK_HOST constant.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - ipv6
Alon Bar-Lev [Thu, 29 Mar 2012 09:16:40 +0000 (11:16 +0200)] 
cleanup: avoid using ~0 - ipv6

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: avoid using ~0 - generic
Alon Bar-Lev [Thu, 29 Mar 2012 09:16:39 +0000 (11:16 +0200)] 
cleanup: avoid using ~0 - generic

Use limits.h for maximum value.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: flags should not be bool
Alon Bar-Lev [Sun, 25 Mar 2012 11:27:02 +0000 (13:27 +0200)] 
cleanup: flags should not be bool

Discussed at [1][2][3].

[1] https://bugs.gentoo.org/show_bug.cgi?id=297854#c2
[2] https://297854.bugs.gentoo.org/attachment.cgi?id=214304
[3] http://sourceforge.net/mailarchive/forum.php?thread_name=20120325111517.GI1359%40greenie.muc.de&forum_name=openvpn-devel

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoMigrated x509_get_sha1_hash to use the garbage collector
Adriaan de Jong [Tue, 14 Feb 2012 10:11:26 +0000 (11:11 +0100)] 
Migrated x509_get_sha1_hash to use the garbage collector

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoMigrated x509_get_serial to use the garbage collector
Adriaan de Jong [Tue, 14 Feb 2012 10:11:25 +0000 (11:11 +0100)] 
Migrated x509_get_serial to use the garbage collector

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoMigrated x509_get_subject to use of the garbage collector
Adriaan de Jong [Tue, 14 Feb 2012 10:11:24 +0000 (11:11 +0100)] 
Migrated x509_get_subject to use of the garbage collector

This also cleans up a messy call in pkcs11.c to _openssl_get_subject, as discussed at FOSDEM.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: James Yonan <james@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoEnable pedantic in windows compilation
Alon Bar-Lev [Wed, 28 Mar 2012 18:43:15 +0000 (20:43 +0200)] 
Enable pedantic in windows compilation

Apparently -ansi undef WIN32 macro.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoFixed off-by-one in serial length calculation
Adriaan de Jong [Tue, 28 Feb 2012 16:29:47 +0000 (17:29 +0100)] 
Fixed off-by-one in serial length calculation

The serial length was one digit too short, resulting in missing digits
at the end of the certificate's stringified serial number.

Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove calls to OpenSSL when building with --disable-ssl
Igor Novgorodov [Tue, 28 Feb 2012 11:16:01 +0000 (15:16 +0400)] 
Remove calls to OpenSSL when building with --disable-ssl

Move OpenSSL calls out from the generic crypto layer and into the
OpenSSL specific layer.  Also don't load all algortihms if SSL
isn't enabled.

Error strings will also not be loaded into memory if ENABLE_SMALL
is configured.

Signed-off-by: Igor Novgorodov <igor@novg.net>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: msvc: upgrade to Visual Studio 2010 + fixups
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:36 +0000 (09:58 +0200)] 
build: msvc: upgrade to Visual Studio 2010 + fixups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: tap: search for tap header
Alon Bar-Lev [Mon, 26 Mar 2012 21:26:36 +0000 (23:26 +0200)] 
build: tap: search for tap header

Windows and solaris has something in common, in both
the tap header is external. So make the Windows tap-windows.h
search common to all platform.

Display an error if we cannot find tap header.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: openbsd: detect netinet/ip.h correctly
Alon Bar-Lev [Mon, 26 Mar 2012 21:26:35 +0000 (23:26 +0200)] 
build: openbsd: detect netinet/ip.h correctly

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: assume dlfcn is available on all supported platforms
Alon Bar-Lev [Mon, 26 Mar 2012 10:34:07 +0000 (12:34 +0200)] 
build: assume dlfcn is available on all supported platforms

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Tested-by: Gert Doering <gert@greenie.muc.de>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: windows: set vendor to openvpn project + cleanups
Alon Bar-Lev [Sat, 24 Mar 2012 06:43:50 +0000 (08:43 +0200)] 
build: windows: set vendor to openvpn project + cleanups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: enable lzo by default
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:37 +0000 (09:58 +0200)] 
build: enable lzo by default

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: autoconf: misc sockets fixups
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:34 +0000 (09:58 +0200)] 
build: autoconf: misc sockets fixups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: ax_varargs.m4: fixups
Alon Bar-Lev [Sat, 24 Mar 2012 07:58:33 +0000 (09:58 +0200)] 
build: ax_varargs.m4: fixups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: use tap-windows.h as external dependency
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:22 +0000 (22:12 +0200)] 
build: use tap-windows.h as external dependency

tap-windows.h is provided by the tap project

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: distribute samples in windows
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:21 +0000 (22:12 +0200)] 
build: distribute samples in windows

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: windows: install version.sh to allow installer read version
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:20 +0000 (22:12 +0200)] 
build: windows: install version.sh to allow installer read version

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move wrappers into platform module
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:19 +0000 (22:12 +0200)] 
build: move wrappers into platform module

+ Some fixups within the platform.c functions.
- need to check environment set on Windows.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: move console related function into its own module
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:18 +0000 (22:12 +0200)] 
cleanup: move console related function into its own module

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move inet_ntop(), inet_pton() emulation into compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:17 +0000 (22:12 +0200)] 
build: move inet_ntop(), inet_pton() emulation into compat

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move daemon() emulation into compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:16 +0000 (22:12 +0200)] 
build: move daemon() emulation into compat

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move gettimeofday() emulation to compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:15 +0000 (22:12 +0200)] 
build: move gettimeofday() emulation to compat

Remove all references to gettimeofday() from main project.

SIDE EFFECT: mingw will use its own internal gettimeofday().

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: split out compat
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:14 +0000 (22:12 +0200)] 
build: split out compat

compat should not use any of the main project headers or conventions,
it should be a standalone library that provides missing library
functions.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: move out config.h include from syshead
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:13 +0000 (22:12 +0200)] 
build: move out config.h include from syshead

Yet another step in reducing the syshead.h content.

Conditional compilation of sources needs to be based on
a minimum program prefix (config.h only).

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: win-msvc: msbuild format
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:12 +0000 (22:12 +0200)] 
build: win-msvc: msbuild format

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: autoconf: update defaults for options
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:11 +0000 (22:12 +0200)] 
build: autoconf: update defaults for options

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: proper crypto detection and usage
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:10 +0000 (22:12 +0200)] 
build: proper crypto detection and usage

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: proper lzo detection and usage
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:09 +0000 (22:12 +0200)] 
build: proper lzo detection and usage

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: properly process lzo-stub
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:08 +0000 (22:12 +0200)] 
build: properly process lzo-stub

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: proper pkcs11-helper detection and usage
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:07 +0000 (22:12 +0200)] 
build: proper pkcs11-helper detection and usage

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: distribute pkg.m4
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:06 +0000 (22:12 +0200)] 
build: distribute pkg.m4

RHEL and others do not install this globally, so we provide our own copy.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: proper selinux detection and usage
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:05 +0000 (22:12 +0200)] 
build: proper selinux detection and usage

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: autoconf: minor cleanups
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:04 +0000 (22:12 +0200)] 
build: autoconf: minor cleanups

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: properly detect and use socket libs
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:03 +0000 (22:12 +0200)] 
build: properly detect and use socket libs

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: libdl usage
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:02 +0000 (22:12 +0200)] 
build: libdl usage

1. properly detect.
2. Link only required components.
3. No way we don't have LoadLibrary on Windows.
4. ENABLE_PLUGIN should be controlled in autoconf.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: autoconf: commands as environment
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:01 +0000 (22:12 +0200)] 
build: autoconf: commands as environment

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: add libtool + windows resources for executables
Alon Bar-Lev [Wed, 29 Feb 2012 20:12:00 +0000 (22:12 +0200)] 
build: add libtool + windows resources for executables

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: standard directory layout
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:59 +0000 (22:11 +0200)] 
build: standard directory layout

Suitable for mature project.

root   - administrative stuff
doc    - documents
src    - sources
tests  - tests
distro - distro specific files
sample - samples

SIDE EFFECT: many changes to rpm spec.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: remove awk and non-standard autoconf output processing
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:58 +0000 (22:11 +0200)] 
build: remove awk and non-standard autoconf output processing

Replace with simpler environment solution.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: autoconf: remove OPENVPN_ADD_LIBS useless macro
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:57 +0000 (22:11 +0200)] 
build: autoconf: remove OPENVPN_ADD_LIBS useless macro

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: autotools: first pass of trivial autotools changes
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:56 +0000 (22:11 +0200)] 
build: autotools: first pass of trivial autotools changes

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: m4/ax_socklen_t.m4: cleanup
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:55 +0000 (22:11 +0200)] 
build: m4/ax_socklen_t.m4: cleanup

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: m4/ax_emptyarray.m4: cleanup
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:54 +0000 (22:11 +0200)] 
build: m4/ax_emptyarray.m4: cleanup

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: m4/ax_varargs.m4: cleanup
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:53 +0000 (22:11 +0200)] 
build: m4/ax_varargs.m4: cleanup

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: split acinclude.m4 into m4/*
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:52 +0000 (22:11 +0200)] 
build: split acinclude.m4 into m4/*

ax_emptyarray.m4  ax_openvpn_lib.m4  ax_socklen_t.m4  ax_varargs.m4

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: remove windows specific build system
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:51 +0000 (22:11 +0200)] 
build: remove windows specific build system

It will be completely re-written in future

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: rename tap-windows function from win32 to win
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:50 +0000 (22:11 +0200)] 
cleanup: rename tap-windows function from win32 to win

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove tap-win32
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:49 +0000 (22:11 +0200)] 
Remove tap-win32

Introduce tap-windows.h which is modified tap-win32/common.h.
Except of function rename, it is the same without the tap_id.
This file should be provided as part of tap-win32 MSI.
For now we hold a copy.

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove easy-rsa
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:48 +0000 (22:11 +0200)] 
Remove easy-rsa

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRemove install-win32
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:47 +0000 (22:11 +0200)] 
Remove install-win32

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: we need the sample.ovpn in future
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:46 +0000 (22:11 +0200)] 
build: we need the sample.ovpn in future

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: plugins: properly use CC, CFLAGS and LDFLAGS
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:45 +0000 (22:11 +0200)] 
build: plugins: properly use CC, CFLAGS and LDFLAGS

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: rename plugin directory to plugins
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:44 +0000 (22:11 +0200)] 
build: rename plugin directory to plugins

This to avoid conflit with plugin.c rules

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: handle printf style format in mingw
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:43 +0000 (22:11 +0200)] 
build: handle printf style format in mingw

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoUpdate .gitignore
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:42 +0000 (22:11 +0200)] 
Update .gitignore

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: correct place to alter WINVER is at build system
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:41 +0000 (22:11 +0200)] 
build: correct place to alter WINVER is at build system

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agofixup: init.c: add missing conditional for ENABLE_CLIENT_CR
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:40 +0000 (22:11 +0200)] 
fixup: init.c: add missing conditional for ENABLE_CLIENT_CR

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: memcmp.c: remove unused source
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:39 +0000 (22:11 +0200)] 
cleanup: memcmp.c: remove unused source

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: tun.c: fix incorrect option in message (ip-win32)
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:38 +0000 (22:11 +0200)] 
cleanup: tun.c: fix incorrect option in message (ip-win32)

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: crypto_openssl.c: remove support for pre-openssl-0.9.6
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:37 +0000 (22:11 +0200)] 
cleanup: crypto_openssl.c: remove support for pre-openssl-0.9.6

autoconf rejecting this anyway:
----
AC_MSG_CHECKING([that OpenSSL Library is at least version 0.9.6])
<snip>
AC_MSG_ERROR([OpenSSL crypto Library is too old.])
----

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: remove redundant ';'
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:36 +0000 (22:11 +0200)] 
cleanup: remove redundant ';'

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: win32.c: wrong printf format
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:35 +0000 (22:11 +0200)] 
cleanup: win32.c: wrong printf format

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: remove C++ warnings
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:34 +0000 (22:11 +0200)] 
cleanup: remove C++ warnings

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agocleanup: options.c: remove redundant include
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:33 +0000 (22:11 +0200)] 
cleanup: options.c: remove redundant include

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agopackage: rpm: strip should be handled by package management
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:32 +0000 (22:11 +0200)] 
package: rpm: strip should be handled by package management

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Samuli Seppänen <samuli@openvpn.net>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agobuild: version should not contain '-'
Alon Bar-Lev [Wed, 29 Feb 2012 20:11:31 +0000 (22:11 +0200)] 
build: version should not contain '-'

Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agofix warnings in event.c when building for win32-64
Heiko Hund [Thu, 18 Aug 2011 12:12:11 +0000 (12:12 +0000)] 
fix warnings in event.c when building for win32-64

When compiling for 64-bit Windows gcc warns about

  "cast from pointer to integer of different size"

on two occasions in file event.c, due to invalid casting.
This patch removes the type casts and uses the correct
format specifier instead.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: James Yonan <james@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/4979
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoremove wrapper code for Windows CryptoAPI function
Heiko Hund [Wed, 17 Aug 2011 15:53:01 +0000 (15:53 +0000)] 
remove wrapper code for Windows CryptoAPI function

The CryptoAPI function CryptAcquireCertificatePrivateKey() was previously
unsupported in MinGW. With recent w32api headers it's now defined, mostly.
Since the code used to load the CryptoAPI DLL is prone to a DLL hijacking
attack [1], it's now a good time to get rid of wrapper completely.

Just a few macros left that may still be undefined on some
systems using the original MinGW headers.

[1] http://isc.sans.edu/diary.html?storyid=9445

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: James Yonan <james@openvpn.net>
URL: http://article.gmane.org/gmane.network.openvpn.devel/4979
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoPreparing OpenVPN 2.3-alpha1 release v2.3-alpha1
David Sommerseth [Tue, 21 Feb 2012 10:12:42 +0000 (11:12 +0100)] 
Preparing OpenVPN 2.3-alpha1 release

Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoRevamp check_file_access() checks in stdin scenarios
David Sommerseth [Mon, 20 Feb 2012 09:31:54 +0000 (10:31 +0100)] 
Revamp check_file_access() checks in stdin scenarios

It was discovered that --management also can take stdin as argument
instead of a file.  Enabled this by revamping the check_file_access()
flags by adding CHKACC_ACPTSTDIN.  Setting this flag will then consider
filenames as 'stdin' as always present.

The other place where 'stdin' was accepted is also modified to use this
flag instead.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
13 years agodefine access mode flag X_OK as 0 on Windows
Heiko Hund [Sat, 18 Feb 2012 19:44:12 +0000 (20:44 +0100)] 
define access mode flag X_OK as 0 on Windows

The _access and _waccess functions in Windows don't know about
X_OK (1). If you pass an uneven mode flag the C runtime's default
invalid parameter handler ends execution of openvpn.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoMakefile.am was missing ssl_common.h
David Sommerseth [Fri, 17 Feb 2012 11:29:27 +0000 (12:29 +0100)] 
Makefile.am was missing ssl_common.h

In commit 9a160b796e1a40f9635231e5533ce40d46dba25f ssl_common.h
was introduced, but never listed as a source file in Makefile.am

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
13 years agoMakefile.am referenced a now non-existing config-win32.h
David Sommerseth [Fri, 17 Feb 2012 11:09:51 +0000 (12:09 +0100)] 
Makefile.am referenced a now non-existing config-win32.h

This file was moved to win/config.h.in and is the template used
by the Python build tools in win/.  This happened in
commit 4b312378e9e7084a0699ca6d4b895bdadb7540db

For all other autotools based environments, ./configure will take
care of creating the proper config.h

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
13 years agomove variable declaration to top of function
Heiko Hund [Fri, 17 Feb 2012 08:39:35 +0000 (09:39 +0100)] 
move variable declaration to top of function

MSVC chokes on this as it's not according to C89.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agomake MSVC link against shell32 as well
Heiko Hund [Thu, 16 Feb 2012 17:30:41 +0000 (18:30 +0100)] 
make MSVC link against shell32 as well

Windows API CommandLineToArgvW(), introduced in Windows unicode path
commit 71bbbd76c62630c88441237d72fe5b61f0b45b2a, is defined therein.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agouse the underscore version of stat on Windows
Heiko Hund [Thu, 16 Feb 2012 17:30:40 +0000 (18:30 +0100)] 
use the underscore version of stat on Windows

MSVC does not know wstat(). Instead _wstat() must be used here.
Unfortunately _wstat() takes a 'struct _stat'. A type 'stat_t' is
introduced to handle this situation in a portable way.

[v2: Use openvpn_stat_t instead of stat_t (David Sommerseth)]

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
13 years agodo not use mode_t on Windows
Heiko Hund [Thu, 16 Feb 2012 17:30:39 +0000 (18:30 +0100)] 
do not use mode_t on Windows

The MSVC headers do not define mode_t. open() uses an int for
the permissions instead. Fixes building with the MSVC based
buildsystem.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoreplace check for TARGET_WIN32 with WIN32
Heiko Hund [Thu, 16 Feb 2012 17:30:38 +0000 (18:30 +0100)] 
replace check for TARGET_WIN32 with WIN32

Use of TARGET_WIN32 breaks MSVC builds as it is only defined
for mingw builds done with the autotools buildsystem.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoFixed wrong return type of cipher_kt_mode
Frank de Brabander [Thu, 16 Feb 2012 12:51:04 +0000 (13:51 +0100)] 
Fixed wrong return type of cipher_kt_mode

The cipher_kt_mode uses bool as return type, this should be int. On
some platforms like OS X, any returned value larger than one will
be converted to 1.

Signed-off-by: Frank de Brabander <brabander@fox-it.com>
Acked-by: Adriaan de Jong <dejong@fox-it.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoConnection entry {tun,link}_mtu_defined not set correctly
David Sommerseth [Tue, 14 Feb 2012 10:45:27 +0000 (11:45 +0100)] 
Connection entry {tun,link}_mtu_defined not set correctly

Commit 76809cae0eae07817160b423d3f9551df1a1d68e enabled setting MTU
variables inside <connection> blocks.  But in that process, the
tun_mtu_defined and link_mtu_defined was not set as it should.

By moving this out of the options_postprocess_mutate_invariant()
function and into options_postprocess_mutate_ce(), these
{tun,link}_mtu_defined variables are set correctly in each
connection entry.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
13 years agoMade some options connection-entry specific
Jan Just Keijser [Tue, 7 Feb 2012 15:29:47 +0000 (16:29 +0100)] 
Made some options connection-entry specific

The following options may now be used in a connection block:

 fragment
 mssfix
 tun-mtu
 tun-mtu-extra
 link-mtu
 mtu_discover_type
 explicit-exit-notification

In order to support stuff like
<connection>
  remote host
  proto udp
  fragment
  explicit-exit-notification 3
</connection>
<connection>
  remote host
  proto tcp
</connection>

Signed-off-by: Jan Just Keijser <janjust@nikhef.nl>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoFix compile issues with status.c
David Sommerseth [Mon, 13 Feb 2012 16:29:52 +0000 (17:29 +0100)] 
Fix compile issues with status.c

Commit 71bbbd76c62630c88441237d72fe5b61f0b45b2a moved over from
calling open() directly to go via the openvpn_open().  It was not
detected that status.c had to include misc.h too.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Heiko Hund <heiko.hund@sophos.com>
13 years agoRemove --show-gateway if debug info is not enabled (--disable-debug)
David Sommerseth [Mon, 13 Feb 2012 15:03:46 +0000 (16:03 +0100)] 
Remove --show-gateway if debug info is not enabled (--disable-debug)

The --show-gateway feature depends on functions only being enabled when
--disable-debug is _not_ used.  As this I consider --show-gateway more
a handy function for debugging, removing this feature when --disable-debug
is used seems like the proper approach.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
13 years agoFix compile issues when plug-ins are disabled.
David Sommerseth [Mon, 13 Feb 2012 14:52:00 +0000 (15:52 +0100)] 
Fix compile issues when plug-ins are disabled.

Commit 1876ccd012e9e2ca6f8e1cd9e7e9bb4bf24ccecb modified
plugin_call() and introduced plugin_call_ssl().  But the similar
approach was missing for situations without plug-ins.

Solution: Rename plugin_call() in the #else !ENABLE_PLUGIN
section to plugin_call_ssl().  Then move the plugin_ssl() function
inside the #ifdef ENABLE_PLUGIN section outside the #ifdef, making
it available for builds with and without plug-ins enabled.

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
13 years agohandle Windows unicode paths
Heiko Hund [Fri, 10 Feb 2012 14:13:42 +0000 (15:13 +0100)] 
handle Windows unicode paths

Openvpn for Windows is not compiled as a Unicode binary and thus cannot
handle paths which contain non-ASCII characters using the argv vector.
Characters that are not present in the system codepage are simply replaced
with a question mark, e.g. if started as 'openvpn --config домой.ovpn'
the file '?????.ovpn' is tried to be opened as configuration.

The same applies to paths in config files which need to be UTF-8
encoded if they contain non ASCII characters. The option line
'key лев.pem' will lead to openvpn trying to open 'лев.pem' on a
system with codepage 1252.

This patch makes openvpn read the command line in UCS-2 and convert
it to UTF-8 internally. Windows stores names in the filesystem in UCS-2.
When using a paths openvpn converts it from UTF-8 to UCS-2 and uses the
wide character Windows API function.

Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoThe code blocks enabled by ENABLE_CLIENT_CR depends on management
Igor Novgorodov [Sun, 12 Feb 2012 18:40:02 +0000 (22:40 +0400)] 
The code blocks enabled by ENABLE_CLIENT_CR depends on management

If the management interface is not enabled, it makes no sense in
including the ENABLE_CLIENT_CR #ifdef blocks.  This will also in
some configurations cause build issues if these blocks are enabled.

Signed-off-by: Igor Novgorodov <igor@novg.net>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoautoconf fixes for building on OSX
Byron Ellacott [Mon, 6 Feb 2012 18:57:00 +0000 (19:57 +0100)] 
autoconf fixes for building on OSX

[DS: a few whitespace fixes was added as well during the merge]

Signed-off-by: Byron Ellacott <bje@apnic.net>
Acked-by: Gilles Espinasse <g.esp@free.fr>
Signed-off-by: David Sommerseth <davids@redhat.com>
13 years agoFix assert() situations where gc_malloc() is called without a gc_arena object
David Sommerseth [Sun, 5 Feb 2012 23:30:47 +0000 (00:30 +0100)] 
Fix assert() situations where gc_malloc() is called without a gc_arena object

In commit bee92b479414d12035b0422f81ac5fcfe14fa645 the gc_malloc() was hardened
to always require a gc_arena object for garbage collection.  Some places in the
code expected the old behaviour of a normal malloc() in these cases, that is a
memory allocation without garbage collection.

This old behaviour is partly restored by allowing string_alloc() to do a non-gc
based allocation if no gc_arena object is available.  In addition some other
places string_alloc() will now be called with a gc_arena pointer where such an
object is available.

The alloc_buf() function has also been refactored to not use gc_malloc() at
all.

v2: - removes a memleak when --ifconfig-ipv6 is used several times
    - makes string_alloc() behave properly if DMALLOC is enabled

Signed-off-by: David Sommerseth <davids@redhat.com>
Acked-by: Gert Doering <gert@greenie.muc.de>