[Openvpn-devel] [PATCH v2 4/9] client-connect: Move multi_client_connect_setenv into early_setup

2015-01-17 Thread Fabian Knittel
This patch moves multi_client_connect_setenv into multi_client_connect_early_setup and makes sure that every client-connect handling function updates the virtual address selection. Background: This unifies how the client-connect handling functions work. Signed-off-by: Fabian Knittel --- src

[Openvpn-devel] [PATCH v2 7/9] client-connect: Add CC_RET_DEFERRED and cope with deferred client-connect

2015-01-17 Thread Fabian Knittel
ional) additional call-back: The call-back for handling the deferred case. If the main call-back returns CC_RET_DEFERRED, the next call to the handler will be through the deferred call-back. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 255 ++--

[Openvpn-devel] [PATCH v2 3/9] client-connect: Refactor multi_client_connect_source_ccd

2015-01-17 Thread Fabian Knittel
Refactor multi_client_connect_source_ccd(), so that options_server_import() (or the success path in general) is only entered in one place within the function. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 29 + 1 file changed, 13 insertions(+), 16 deletions

[Openvpn-devel] [PATCH v2 5/9] client-connect: Refactor to use return values instead of modifying a passed-in flag

2015-01-17 Thread Fabian Knittel
completely identical ways. This is in preparation of handling the helpers as simple call-backs. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 122 +++- src/openvpn/multi.h | 11 - 2 files changed, 82 insertions(+), 51 deletions(-) diff

[Openvpn-devel] [PATCH v2 8/9] client-connect: Add deferred support to the client-connect script handler

2015-01-17 Thread Fabian Knittel
value for deferral into the deferred_ret_file, the handler knows to indicate deferral. Later on, the deferred handler checks whether the value of the deferred_ret_file has been updated to success or failure. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 185

[Openvpn-devel] [PATCH v2 9/9] client-connect: Add deferred support to the client-connect plugin v1 handler

2015-01-17 Thread Fabian Knittel
Uses the infrastructure provided and used in the previous patch to provide deferral support to the v1 client-connect plugin handler as well. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 32 1 file changed, 20 insertions(+), 12 deletions(-) diff --git

[Openvpn-devel] [PATCH v2 2/9] client-connect: Properly indent all functions

2015-01-17 Thread Fabian Knittel
This patch adds proper indentation to all new helper functions. No functional changes are performed. Nothing is moved around. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 408 ++-- 1 file changed, 204 insertions(+), 204 deletions

[Openvpn-devel] [PATCH v2 6/9] client-connect: Refactor client-connect handling to calling a bunch of hooks in a loop

2015-01-17 Thread Fabian Knittel
This patch changes the calling of the client-connect functions into an array of hooks and a block of code that calls them in a loop. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 57 +++-- 1 file changed, 16 insertions(+), 41 deletions

[Openvpn-devel] [PATCH v2 1/9] client-connect: Split multi_connection_established into separate functions

2015-01-17 Thread Fabian Knittel
patch will only do indentation changes.) Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 322 ++ src/openvpn/options.h | 6 + 2 files changed, 224 insertions(+), 104 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c

[Openvpn-devel] [PATCH v2 0/9] Refactor client-connect / add support for deferred handling

2015-01-17 Thread Fabian Knittel
lso availabe on a Github branch: https://github.com/fknittel/openvpn/tree/feat_deferred_client-connect Cheers Fabian PS: See https://github.com/fknittel/openvpn/wiki/Patch-set-%22deferred-client-connect%22 in case you're interested in ready-made Debian packages. Fabian Knittel (9): client-

[Openvpn-devel] [PATCH 4/9] client-connect: Move multi_client_connect_setenv into early_setup

2014-10-10 Thread Fabian Knittel
This patch moves multi_client_connect_setenv into multi_client_connect_early_setup and makes sure that every client-connect handling function updates the virtual address selection. Background: This unifies how the client-connect handling functions work. Signed-off-by: Fabian Knittel --- src

[Openvpn-devel] [PATCH 5/9] client-connect: Refactor to use return values instead of modifying a passed-in flag

2014-10-10 Thread Fabian Knittel
completely identical ways. This is in preparation of handling the helpers as simple call-backs. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 122 +++- src/openvpn/multi.h | 11 - 2 files changed, 82 insertions(+), 51 deletions(-) diff

[Openvpn-devel] [PATCH 2/9] client-connect: Properly indent all functions

2014-10-10 Thread Fabian Knittel
This patch adds proper indentation to all new helper functions. No functional changes are performed. Nothing is moved around. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 408 ++-- 1 file changed, 204 insertions(+), 204 deletions

[Openvpn-devel] [PATCH 8/9] client-connect: Add deferred support to the client-connect script handler

2014-10-10 Thread Fabian Knittel
value for deferral into the deferred_ret_file, the handler knows to indicate deferral. Later on, the deferred handler checks whether the value of the deferred_ret_file has been updated to success or failure. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 177

[Openvpn-devel] [PATCH 9/9] client-connect: Add deferred support to the client-connect plugin v1 handler

2014-10-10 Thread Fabian Knittel
Uses the infrastructure provided and used in the previous patch to provide deferral support to the v1 client-connect plugin handler as well. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a

[Openvpn-devel] [PATCH 6/9] client-connect: Refactor client-connect handling to calling a bunch of hooks in a loop

2014-10-10 Thread Fabian Knittel
This patch changes the calling of the client-connect functions into an array of hooks and a block of code that calls them in a loop. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 57 +++-- 1 file changed, 16 insertions(+), 41 deletions

[Openvpn-devel] [PATCH 0/9] Refactor client-connect / add support for deferred handling

2014-10-10 Thread Fabian Knittel
branch: https://github.com/fknittel/openvpn/tree/feat_deferred_client-connect Cheers Fabian PS: See https://github.com/fknittel/openvpn/wiki/Patch-set-%22deferred-client-connect%22 in case you're interested in ready-made Debian packages. Fabian Knittel (9): client-connect: Split multi_connec

[Openvpn-devel] [PATCH 3/9] client-connect: Refactor multi_client_connect_source_ccd

2014-10-10 Thread Fabian Knittel
Refactor multi_client_connect_source_ccd(), so that options_server_import() (or the success path in general) is only entered in one place within the function. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 29 + 1 file changed, 13 insertions(+), 16 deletions

[Openvpn-devel] [PATCH 1/9] client-connect: Split multi_connection_established into separate functions

2014-10-10 Thread Fabian Knittel
patch will only do indentation changes.) Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 312 +++--- src/openvpn/options.h | 6 + 2 files changed, 224 insertions(+), 94 deletions(-) diff --git a/src/openvpn/multi.c b/src/openvpn/multi.c

[Openvpn-devel] [PATCH 7/9] client-connect: Add CC_RET_DEFERRED and cope with deferred client-connect

2014-10-10 Thread Fabian Knittel
ional) additional call-back: The call-back for handling the deferred case. If the main call-back returns CC_RET_DEFERRED, the next call to the handler will be through the deferred call-back. Signed-off-by: Fabian Knittel --- src/openvpn/multi.c | 255 ++--

Re: [Openvpn-devel] Async OPENVPN_PLUGIN_CLIENT_CONNECT plugin support

2014-10-10 Thread Fabian Knittel
Hi Lev, 2014-10-07 20:50 GMT+02:00 Lev Stipakov : > Patch works great, thanks! I have rebased it a bit and added support > for client-connect plugin call. > Great to hear that my patch works for you! I've finally rebased the patches too, due to my current users complaining about the old OpenVPN

Re: [Openvpn-devel] Async OPENVPN_PLUGIN_CLIENT_CONNECT plugin support

2014-07-31 Thread Fabian Knittel
Hi Lev, 2014-07-29 12:56 GMT+02:00 Lev Stipakov : > I am pondering about asynchronous OPENVPN_PLUGIN_CLIENT_CONNECT > callback. Basically, I want _not_ to establish connection until > response is received and ofcI don't want to block rest of traffic. > [ Details of approach snipped. ] What do

Re: [Openvpn-devel] [PATCH] Repair "tap server" mode brokenness caused by fallout

2012-07-01 Thread Fabian Knittel
Hi everyone, 2012/6/30 Gert Doering : > diff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c > index aecb702..850e336 100644 > --- a/src/openvpn/mroute.c > +++ b/src/openvpn/mroute.c > @@ -52,7 +52,7 @@ mroute_addr_init (struct mroute_addr *addr) >  static inline bool >  is_mac_mcast_addr (con

Re: [Openvpn-devel] [RFC] Split plugins into their own repositories

2012-05-13 Thread Fabian Knittel
Hi Alon, 2012/5/13 Alon Bar-Lev : > On Sun, May 13, 2012 at 9:10 PM, Gert Doering wrote: >> Huh?  You're the master of Autoconf, and I'm sure you will be able to >> produce a working PAM detection for those platforms that have it. > > Yes, and as such I tell you that automatic detection is someth

Re: [Openvpn-devel] [PATCH] Openvpn for Android 4.0 Changeset

2012-05-11 Thread Fabian Knittel
Hi Alon, 2012/5/11 Alon Bar-Lev : > On Fri, May 11, 2012 at 12:11 AM, Fabian Knittel > wrote: >> The main undecided points regarding the interface side of things appear to >> be: >> * How to pass the fds back and forth: Special-case the management >>  interface fo

Re: [Openvpn-devel] [PATCH] Openvpn for Android 4.0 Changeset

2012-05-10 Thread Fabian Knittel
Hi, 2012/5/10 David Sommerseth : > On 10/05/12 16:50, Alon Bar-Lev wrote: >> Why? plugin is adding a custom logic, and you need custom logic. As >> I wrote it does not imply that you implement your JNI there. > > Okay ... fine ... there are plenty of big visions for a future version > of OpenVPN,

Re: [Openvpn-devel] [PATCH] build: add git revision to --version output if build from git repository

2012-05-03 Thread Fabian Knittel
Hi, 2012/5/3 David Sommerseth : > What I would like to see is something more like what's found in TOR > projects' obfsproxy, where the Makefile generates a micro-version.i, > which is included.  As this file is forced to be (re-)created each > time, it will always be accurate. > > I don't say that

Re: [Openvpn-devel] [PATCH] Presume that Linux is always IPv6 capable at build time

2012-04-26 Thread Fabian Knittel
Hi Alon, 2012/4/26 Alon Bar-Lev : > At embedded system and several distros like Gentoo, the ipv6 should be > made enable/disabled, just like any other project. > It is the same #ifdef as we already have these in code. > Even in 2012 kernels can be compiled without ipv6. If embedded systems really

Re: [Openvpn-devel] [PATCH] Presume that Linux is always IPv6 capable at build time

2012-04-26 Thread Fabian Knittel
Hi David, 2012/4/26 David Sommerseth : > These days it is highly unlikely that OpenVPN will be built in a non-IPv6 > capable Linux environment. Agreed. > This also solves an issue which was introduced in commit 51bd56f46f55177cf0f8b > where HAVE_TUN_PI and HAVE_IPHDR is no longer detected.  As t

Re: [Openvpn-devel] [PATCH] cleanup: add .gitattributes to control eol style explicitly

2012-04-26 Thread Fabian Knittel
Hi Alon, 2012/4/2 Alon Bar-Lev : > Having the text auto detection is a risk, as the detection may detect > text files that are not text and vise versa. > > Having global setting will create confusion and differentiate between > users. So this patch also move this to local repository. IMHO, this i

Re: [Openvpn-devel] [PATCH] cleanup: plugin: support C++ plugin

2012-04-26 Thread Fabian Knittel
Hi Alon, 2012/4/7 Alon Bar-Lev : > Signed-off-by: Alon Bar-Lev > --- >  include/openvpn-plugin.h |    8 >  1 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/include/openvpn-plugin.h b/include/openvpn-plugin.h > index f82f61f..1c80eec 100644 > --- a/include/openvpn-plugin.

Re: [Openvpn-devel] [PATCH] cleanup: remove C++ comments

2012-04-26 Thread Fabian Knittel
Hi Alon, 2012/4/7 Alon Bar-Lev : > Signed-off-by: Alon Bar-Lev > --- >  src/openvpnserv/openvpnserv.c |    6 +++--- >  1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/src/openvpnserv/openvpnserv.c b/src/openvpnserv/openvpnserv.c > index a9a9441..56f5a02 100755 > --- a/src/openvp

Re: [Openvpn-devel] [PATCH 1/6] Added support for new PolarSSL 1.1 RNG

2012-04-02 Thread Fabian Knittel
Hi Alon, 2012/4/2 Alon Bar-Lev : > I also intend to work and cleanup the whole PolarSSL/OpenSSL mess... > > Design will be to introduce crypto engine callback structure, > registering openssl and polarssl, in a way that code is using the > callback structure while using runtime configuration one c

Re: [Openvpn-devel] [DISCUSS] OpenVPN public repositories at github.com

2012-03-30 Thread Fabian Knittel
Hi, 2012/3/30 Samuli Seppänen : >>> [*] As in "We will have the community services on our own servers. Period." BTW: If you like self-hosting, we're experimenting with Gerrit for code review (also provides Git repo hosting as a by-product) and it's looking quite promising. Would formalise the ACK

Re: [Openvpn-devel] [PATCH] Avoid using ~0

2012-03-28 Thread Fabian Knittel
Hi Alon, I stumbled over a minor mistake: 2012/3/28 Alon Bar-Lev : > diff --git a/src/openvpn/route.c b/src/openvpn/route.c > index bf7af63..05ea57f 100644 > --- a/src/openvpn/route.c > +++ b/src/openvpn/route.c > @@ -1367,7 +1367,7 @@ add_route (struct route *r, >     else if ((flags & ROUTE_MET

Re: [Openvpn-devel] 2.3alpha1 fails on OS X when the --up argument contains more than an execution path

2012-03-28 Thread Fabian Knittel
Hi Jonathan, 2012/3/28 Jonathan K. Bullard : > There is one part of check_cmd_access() which I took from code in > run_up_down() and I am not sure about -- the three lines: >   gc_arena gc; > and >   gc = gc_new (); > and >   gc_free (&gc); > > Are they needed? I put them in because I assume that

Re: [Openvpn-devel] [PATCH] build: rename bool->obool

2012-03-25 Thread Fabian Knittel
Hi Alon, 2012/3/24 Alon Bar-Lev : > On Sat, Mar 24, 2012 at 9:15 PM, Alon Bar-Lev wrote: >> PPC architectures and conflict with stdbool.h. >> >> basic.h defines a type 'bool' that conflicts with the altivec >> keyword bool which has to be fixed upstream, see bugs[1][2]. >> >> [1] https://bugs.gen

Re: [Openvpn-devel] [PATCH 35/52] build: proper selinux detection and usage

2012-03-16 Thread Fabian Knittel
Hi Alon, >> AC_CHECK_LIB([selinux], [setcon], [SELINUX_LIBS="-lselinux"]) >> >> versus >> >> AC_CHECK_HEADER([selinux/selinux.h], [ >>    AC_CHECK_LIB([selinux], [setcon], [SELINUX_LIBS="-lselinux"], >>        [AC_MSG_RESULT([SELinux library not found.])] >>    )],  [AC_MSG_ERROR([SELinux headers

Re: [Openvpn-devel] [PATCH 35/52] build: proper selinux detection and usage

2012-03-16 Thread Fabian Knittel
Hi Alon, sorry for digging up the dead, but our disagreements might have started earlier and just went unnoticed so far ... :) 2012/3/8 Alon Bar-Lev : > I wrote this in the introduction of the patch set. > > There are two approaches to detecting dependencies: > > 1. Detect all compile time depend

Re: [Openvpn-devel] New generic buildsystem: lzo enabled or disabled by default?

2012-03-16 Thread Fabian Knittel
Hi Alon, 2012/3/16 Alon Bar-Lev : > On Fri, Mar 16, 2012 at 3:29 PM, Fabian Knittel > wrote: >> In my opinion, the build defaults should reflect what the project >> considers as the recommended defaults - the features we want to see in >> every typical OpenVPN server an

Re: [Openvpn-devel] New generic buildsystem: lzo enabled or disabled by default?

2012-03-16 Thread Fabian Knittel
Hi, 2012/3/16 Alon Bar-Lev : > If we do not want to do auto detection, enabling optional components > may lead to configure failure, and force the user to explicitly > disable this feature. > > It is possible, and I don't mind so much, however, I prefer configure > to use the minimum absolutely ne

Re: [Openvpn-devel] [Openvpn-users] OpenVPN 2.3-alpha1 released

2012-03-13 Thread Fabian Knittel
Hi, 2012/3/13 Heiko Hund : > On Monday 12 March 2012 19:01:41 Alon Bar-Lev wrote: >> What is the baseline? This what we should agree first... >> Should openvpn daemon be run on completely unprivileged account or not. > > I don't support the idea about running openvpn.exe with elevated privileges.

Re: [Openvpn-devel] [Openvpn-users] OpenVPN 2.3-alpha1 released

2012-03-09 Thread Fabian Knittel
Hi Heiko, Am 9. März 2012 14:42 schrieb Heiko Hund : > Instead I plan to secure the process (and the probably the pipe handle as > well) against malicious operations by not granting the user any sophisticated > access to it, i.e. you can only inject code if you can write the process' > memory. Thi

Re: [Openvpn-devel] [Openvpn-users] OpenVPN 2.3-alpha1 released

2012-02-29 Thread Fabian Knittel
Hi Gert, 2012/2/29 Gert Doering : > The model we follow is "openvpn.exe has the same permissions that you > already have, so there is no benefit in manipulating anything". That was my initial assumption, which would imply that there's no reason to restrict access to the named pipe (apart from mak

Re: [Openvpn-devel] [Openvpn-users] OpenVPN 2.3-alpha1 released

2012-02-29 Thread Fabian Knittel
Hi Heiko, 2012/2/29 Heiko Hund : > On Wednesday 29 February 2012 14:07:01 Fabian Knittel wrote: [...] >> (There must be something missing, otherwise >> I don't get why you call it "interactive service" ...?) > > It's interactive in contrast to the

Re: [Openvpn-devel] [Openvpn-users] OpenVPN 2.3-alpha1 released

2012-02-29 Thread Fabian Knittel
Hi Heiko, Am 29. Februar 2012 13:18 schrieb Heiko Hund : > [...] There will be a new service, I called it > interactive service. The GUI/client connects to a named pipe of that service. > It passes the working directory, command line options and stdin input for > openpvn to the service. The servic

Re: [Openvpn-devel] [PATCH 1/2] Added support for new PolarSSL 1.1 RNG

2012-02-28 Thread Fabian Knittel
Hi Adriaan, I only found a minor nit: 2012/2/28 Adriaan de Jong : > --- a/ssl.c > +++ b/ssl.c > @@ -385,6 +385,11 @@ init_ssl (const struct options *options, struct > tls_root_ctx *new_ctx) >       tls_ctx_restrict_ciphers(new_ctx, options->cipher_list); >     } > > +#ifdef USE_POLARSSL > +  /*

Re: [Openvpn-devel] [PATCH 01/02] Add support for PolarSSL 1.1.x branch

2012-02-28 Thread Fabian Knittel
Hi Igor, 2012/2/28 Igor Novgorodov : > On 28.02.2012 1:37, Fabian Knittel wrote: >> Your patch removes the code that causes havege_init() to only be >> called once. You never want to initialise your PRNG more than once, >> otherwise you increase the risk that your randomness

Re: [Openvpn-devel] [PATCH 01/02] Add support for PolarSSL 1.1.x branch

2012-02-27 Thread Fabian Knittel
Hi Igor, 2012/2/27 Igor Novgorodov : > The attached patch adds checking for PolarSSL version on crypto_polarssl.c > and depending on which version we are using (1.0.x or 1.1.x) chooses a new > shiny havege_random() function, or an old ugly while{} loop hack to generate > randomness. Your patch re

Re: [Openvpn-devel] OpenVPN and Android 4.0 VPN API

2012-02-08 Thread Fabian Knittel
Hi Gert, 2012/2/8 Gert Doering : > On Wed, Feb 08, 2012 at 11:27:10AM -0800, James Ring wrote: >> Does other code within openvpn care whether the fd is a UNIX socket or >> a tun/tap device? I'm guessing there may be some ioctls it wants to >> perform on the device. > > There aren't any ioctl()s (I

Re: [Openvpn-devel] OpenVPN and Android 4.0 VPN API

2012-02-08 Thread Fabian Knittel
Hi James, 2012/2/8 James Ring : > On Wed, Feb 8, 2012 at 10:24 AM, Gert Doering wrote: >> Exactly.  The first three things are sort of "nearly done", the >> "receive file descriptor to use for tun/tap" would need to be >> implemented (tun.c, open_tun(), #ifdef ANDROID_MAGIC_VPN :-) ) > > I was th

Re: [Openvpn-devel] Problem with alloc_buf_gc function

2011-12-11 Thread Fabian Knittel
Hi Tiran, Am 11.12.2011 21:57, schrieb Tiran Kaskas: > Looking into the function alloc_buf_gc() in file buffer.c, it returns a > struct buffer, which seems to me is allocated on the stack, which is > causing an issue, I believe, since the function calling alloc_buf_gc() > will work on a buffer whi

Re: [Openvpn-devel] [PATCH] Add option to disable priority tagged packets (VID=0)

2011-12-08 Thread Fabian Knittel
Hi Alon, Am 08.12.2011 21:17, schrieb Alon Bar-Lev: > I fail to understand why this is relevant as far as usage (openvpn --help) and > manual (man openvpn) to document this. Ah. Sorry for the misunderstanding. Are you referring to the specific patch by Michael? I agree that it would have neede

Re: [Openvpn-devel] [PATCH] Add option to disable priority tagged packets (VID=0)

2011-12-08 Thread Fabian Knittel
Hi Michael, Hi David, Hi Alon, On 08/12/11 09:33, michael-dev wrote: > This patch adds an option to disable the creation of tagged priority > packets with VID=0. This is for the feature_vlan_tagging > openvpn-testing head. Great to know that other people are using the patch-set too. Your patch i

Re: [Openvpn-devel] Summary of the IRC meeting (20th May 2010)

2010-05-25 Thread Fabian Knittel
Am 25.05.2010 10:42, schrieb David Sommerseth: > Personally, I would also not enforce BSD as the only license for > bounties. We need to provide at least a choice, at least between GPL > and BSD. > > I would not consider to license my contributions to OpenVPN as BSD, > because a) I want other peo

[Openvpn-devel] RFC: Strip 802.1Q priority, when going from tagged to untagged?

2010-05-05 Thread Fabian Knittel
Hi, as we've now completed (almost) all necessary building blocks for running OpenVPN in our intended environment, we've started testing the feat_vlan_tagging branch in earnest. Of course, we've immediately encountered the first problem. :) Currently, if VLAN-tagged packets coming in on the tap

[Openvpn-devel] [PATCH] ssl.c: fix use of openvpn_run_script()'s return value

2010-05-04 Thread Fabian Knittel
ling is fine for the other places where openvpn_run_script() is used, because those places previously used openvpn_execve_check() (notice the "_check" suffix). Signed-off-by: Fabian Knittel --- ssl.c | 20 ++-- 1 files changed, 6 insertions(+), 14 deletions(-) diff --git

[Openvpn-devel] [PATCH 6/6] vlan: move htons / ntohs into vlanhdr_get/_set functions

2010-04-28 Thread Fabian Knittel
. The patch moves all htons() and ntohs() conversions into the vlan_hdr_* functions to avoid the needless repetition. The vlan_hdr_* functions now expect and return the values in host byte order. The callee doesn't need to perform any kind of conversion. Signed-off-by: Fabian Knittel --- mu

[Openvpn-devel] [PATCH 2/6] vlan: use uint16_t for storage of the VID where possible

2010-04-28 Thread Fabian Knittel
returning -1. The patch should not cause any changes in behaviour. The improvement was suggested by Peter Stuge. Signed-off-by: Fabian Knittel --- mroute.c |6 +++--- mroute.h |6 +++--- multi.c | 24 options.c |2 +- options.h |2 +- proto.

[Openvpn-devel] [PATCH 4/6] vlan: Improve documentation of remove_vlan_tag()

2010-04-28 Thread Fabian Knittel
This patch improves the comments that document the remove_vlan_tag() function. It clarifies what is meant by "priority-tagged frames" and documents the parameters and return value. Signed-off-by: Fabian Knittel --- multi.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletion

[Openvpn-devel] [PATCH 5/6] vlan: is_ipv4: fix position of variable definition

2010-04-28 Thread Fabian Knittel
To avoid difficulties on older / stricter C compilers, this patch moves the variable definition to the beginning of the block in is_ipv4(). Found by Peter Stuge. Signed-off-by: Fabian Knittel --- proto.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/proto.c b

[Openvpn-devel] [PATCH 1/6] vlan: Mention 802.1Q in configuration descriptions

2010-04-28 Thread Fabian Knittel
To clarify that the tagging/untagging is based on the 802.1Q standard, this patch adds "802.1Q-based" to a few descriptive strings. The improvement was suggested by Peter Stuge. Signed-off-by: Fabian Knittel --- configure.ac |4 ++-- options.c|2 +- 2 files changed, 3

[Openvpn-devel] [PATCH 0/6] Updates to VLAN patches

2010-04-28 Thread Fabian Knittel
branch on git://fsmi-dev.fsmi.uni-karlsruhe.de/openvpn.git Cheers Fabian Fabian Knittel (6): vlan: Mention 802.1Q in configuration descriptions vlan: use uint16_t for storage of the VID where possible vlan: slightly clean-up buf_filter_incoming_vlan_tags() vlan: Improve docume

[Openvpn-devel] [PATCH 3/6] vlan: slightly clean-up buf_filter_incoming_vlan_tags()

2010-04-28 Thread Fabian Knittel
This patch changes buf_filter_incoming_vlan_tags() to use a less nested code-style. It also improves documentation of the function. In addition, the function is made static, as it is only used locally. Code based on a snippet by Peter Stuge. Signed-off-by: Fabian Knittel --- multi.c | 39

Re: [Openvpn-devel] [PULL-REQUEST v3] VLAN-Tagging

2010-04-28 Thread Fabian Knittel
Hi Peter, Peter Stuge wrote: Fabian Knittel wrote: +++ b/configure.ac @@ -212,6 +212,12 @@ AC_ARG_ENABLE(selinux, [SELINUX="yes"] ) +AC_ARG_ENABLE(vlan-tagging, + [ --disable-vlan-tagging Disable support for VLAN tagging/untagging], + [VLAN_TAGGING=&

Re: [Openvpn-devel] [PULL-REQUEST v3] VLAN-Tagging

2010-04-28 Thread Fabian Knittel
Hi David, David Sommerseth wrote: > I've finally found some time to dig into this again. After some > consideration, I decided to rebase your work on your feat_vlan_tagging > branch against the openvpn-testing.git feat_vlan_tagging branch. > > This means that your earlier patches without signed-

Re: [Openvpn-devel] [PATCHv2 1/3] Harden create_temp_filename() (version 2)

2010-04-16 Thread Fabian Knittel
Hi David, David Sommerseth wrote: > +} > + while (attempts < 6); > > - return gen_path (directory, BSTR (&fname), gc); > + msg (M_FATAL, "Failed to create temporary file after %i attempts", > attempts); > + return NULL; > } I noticed something else ... if - hypothetically - someone ma

Re: [Openvpn-devel] [PATCHv2 2/3] Renamed all calls to create_temp_filename()

2010-04-16 Thread Fabian Knittel
Hi David, David Sommerseth wrote: > diff --git a/multi.c b/multi.c > index 2b04428..826a113 100644 > --- a/multi.c > +++ b/multi.c > @@ -1530,7 +1530,13 @@ multi_connection_established (struct multi_context *m, > struct multi_instance *mi >if (plugin_defined (mi->context.plugins, > OPENV

Re: [Openvpn-devel] [PATCH] Harden create_temp_filename()

2010-04-16 Thread Fabian Knittel
Hi David, David Sommerseth wrote: > On 16/04/10 11:35, Gert Doering wrote: >> Hi, > >> On Fri, Apr 16, 2010 at 11:16:32AM +0200, David Sommerseth wrote: >>> I'll look more into this, as the only advantage is that if open() with >>> O_EXCL|O_CREAT fails if the file exists, it should be used instea

Re: [Openvpn-devel] [PATCH] Harden create_temp_filename()

2010-04-16 Thread Fabian Knittel
Hi David, David Sommerseth schrieb: > As promised in the meeting today, a patch for hardening > create_temp_filename(). Great! :) > I've added more checks to what create_temp_filename() returns where it > is called in addition, to make it even safer. > + do { > uint8_t rndbytes[16]; >

[Openvpn-devel] [PULL-REQUEST v3] VLAN-Tagging

2010-04-12 Thread Fabian Knittel
struct mroute_addr *esrc, struct mroute_addr *edest, - const struct buffer *buf); + const struct buffer *buf, + int16_t vid); unsigned int ret = 0; verify_align_4 (buf); if (tunnel_type == DEV_TYPE_TUN) ret = mroute_extract_addr_ipv4 (src, dest, buf);

Re: [Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-04-11 Thread Fabian Knittel
Hi, Gert Doering schrieb: > On Thu, Apr 01, 2010 at 10:59:05AM +0200, Jan Just Keijser wrote: >>> Hm, nice idea. I'll implement it in my next round of patches. >>> >> FYI: 802.1Q defines VLAN 1 as the 'native' LAN: all packets on VLAN 1 >> are *by definition* not encapsulated (according to my

Re: [Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-04-11 Thread Fabian Knittel
Hi Gert, Gert Doering wrote: > Something else I need to check: the "standard" mroute code hashes based > on ethernet address (in tap mode). What happens if the same MAC address > shows up for two different VLAN IDs? (Not very likely for virtual > ethernet devices, though, but this can happen in

Re: [Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-04-11 Thread Fabian Knittel
[ I just noticed that I accidentally sent this only to David and not to the list. It was written and sent on Thu, 01 Apr 2010 15:46:21 +0200 ] David Sommerseth wrote: > But what kind traffic does hit the OpenVPN clients? Does the OpenVPN > server send only traffic to the corresponding VLAN the

[Openvpn-devel] [PATCH-SET v2] VLAN-tagging

2010-04-05 Thread Fabian Knittel
if (proto == OPENVPN_ETH_P_8021Q && + BLEN (buf) >= (int) sizeof (struct openvpn_8021qhdr)) { const struct openvpn_8021qhdr *tag = (const struct openvpn_8021qhdr *) BPTR (buf); proto = ntohs (tag->proto); @@ -314,7 +322,9 @@ mroute_addr_print_ex (const struct mroute_

Re: [Openvpn-devel] [RFC][PATCH 0/9] VLAN tagging on TAP devices in OpenVPN server mode

2010-04-01 Thread Fabian Knittel
David Sommerseth schrieb: > If you have a public git tree available, I could pull that as well. (I > tried the git URL the webUI gave me yesterday, without luck). Ah, thanks for noticing ... the non-ssh path apparently doesn't get used often. I forgot to fix the URLs since switching to gitosis. I

Re: [Openvpn-devel] [RFC][PATCH 0/9] VLAN tagging on TAP devices in OpenVPN server mode

2010-04-01 Thread Fabian Knittel
David Sommerseth schrieb: > On 01/04/10 10:32, Fabian Knittel wrote: >> We'll definitely be doing that over here. My main concern was whether >> we would have to patch OpenVPN indefinitely with local enhancements or >> whether there was a chance to include it upst

Re: [Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-04-01 Thread Fabian Knittel
Jan Just Keijser schrieb: > Peter Stuge wrote: >> Look at the spec, Table 9-2 on page 86. (100 in PDF) >> >> VID Use >> 0 "no VLAN identifier is present in the frame" >> 1 "The default PVID value used for classifying frames on ingress .. >> The PVID value of a Port can be changed by manage

Re: [Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-04-01 Thread Fabian Knittel
Peter Stuge schrieb: > Jan Just Keijser wrote: >> FYI: 802.1Q defines VLAN 1 as the 'native' LAN: all packets on VLAN 1 >> are *by definition* not encapsulated (according to my CCNA guide ;-)) [...] >> Perhaps we need to make sure that VID 1 means untagged ... > > Any VID can be untagged. While 1

Re: [Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-04-01 Thread Fabian Knittel
Fabian Knittel schrieb: > Peter Stuge schrieb: >> It would be nice to be able to use VID 0 to mean untagged packets. > > Hm, nice idea. I'll implement it in my next round of patches. I've just noticed a detail that might warrant discussion. To make sure we're talk

Re: [Openvpn-devel] [RFC][PATCH 0/9] VLAN tagging on TAP devices in OpenVPN server mode

2010-04-01 Thread Fabian Knittel
Hi David, David Sommerseth schrieb: > Thank you very much for your patches! I'll look into them soon. Thanks! > The > patches seems to apply nicely against the feat_passtos branch. I was > worried about a conflict here, until I noticed where you had your roots :) Actually, I was lucky to noti

Re: [Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-04-01 Thread Fabian Knittel
Peter Stuge schrieb: > Fabian Knittel wrote: >> + if (ntohs (vlanhdr.tpid) != OPENVPN_ETH_P_8021Q) >> +{ >> + /* Drop untagged frames */ >> + goto err; >> +} > > It would be nice to be able to use VID 0 to mean untagged packets. Hm, n

Re: [Openvpn-devel] [PATCH 3/9] vlan: Add per-client --vlan-tag option

2010-04-01 Thread Fabian Knittel
Hi Peter, Peter Stuge schrieb: > Fabian Knittel wrote: >> +#define OPENVPN_8021Q_MAX_VID 0xFFFE > > The max VID in 802.1q is 4095 = 0xfff. You are absolutely correct. Thanks for catching that. I intended it to say 0xFFE, because the standard talks about VID values being valid w

[Openvpn-devel] [PATCH 2/9] vlan: Add global --vlan-tagging option

2010-03-31 Thread Fabian Knittel
This patch adds the new "--vlan-tagging" boolean option. The option is valid in server mode. It is off by default. The flag indicates whether openvpn should assume the tap device to be in tagged mode, i.e. packets coming in on the device are tagged via IEEE 802.1Q and packets going out through t

[Openvpn-devel] [PATCH 3/9] vlan: Add per-client --vlan-tag option

2010-03-31 Thread Fabian Knittel
This patch adds the new "--vlan-tag" integer option. The option is valid in server mode and can be set in a client context (e.g. from the client-connect hook). It defaults to 0. The value indicates which VID (VLAN identifier) to associate with a client. The client will only receive packets which

[Openvpn-devel] [PATCH 4/9] vlan: Prepend and remove VLAN identifiers on outgoing and incoming frames

2010-03-31 Thread Fabian Knittel
This patch adds parsing of the IEEE 802.1Q headers for incoming and outgoing ethernet frames. For frames coming in from the tap interface, the 802.1Q header is parsed and translated into a regular Ethernet II header. Note that the Priority Code Point (PCP) and Canonical Format Indicator (CFI) fie

[Openvpn-devel] [PATCH 8/9] vlan: add debug logging to tagging / untagging

2010-03-31 Thread Fabian Knittel
--- multi.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/multi.c b/multi.c index 822ae29..661fd98 100644 --- a/multi.c +++ b/multi.c @@ -2143,11 +2143,15 @@ remove_vlan_identifier (struct buffer *buf) if (ntohs (vlanhdr.tpid) != OPENVPN_ETH_P_8021Q) {

[Openvpn-devel] [RFC][PATCH 0/9] VLAN tagging on TAP devices in OpenVPN server mode

2010-03-31 Thread Fabian Knittel
concept. At this point I'm very interested in all kinds of feed-back and would like to determine whether you might be interested in integrating something like this in an official OpenVPN release at some point. Cheers Fabian Fabian Knittel (9): is_ipv4(): add packet length check for 802.1Q

[Openvpn-devel] [PATCH 7/9] vlan: Slightly enhance PF's protocol inspection of 802.1Q packets

2010-03-31 Thread Fabian Knittel
To allow openvpn's PF code to inspect IP packets contained within 802.1Q packets, this patch enhances mroute_extract_addr_ether() to properly skip over the 802.1Q header. --- mroute.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/mroute.c b/mroute.c index 1040b8

[Openvpn-devel] [PATCH 6/9] vlan: Restrict broadcasts to the sender's VLAN.

2010-03-31 Thread Fabian Knittel
This patch enhances openvpn's internal packet routing to restrict broadcast packets to destinations with a matching VID. I.e. broadcasts from client to client or from tap interface to clients are now filtered based on whether the client belongs to the correct VLAN id. --- multi.c | 15 +

[Openvpn-devel] [PATCH 9/9] vlan: add debug logging to broadcast filter

2010-03-31 Thread Fabian Knittel
--- multi.c | 16 +++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/multi.c b/multi.c index 661fd98..641d464 100644 --- a/multi.c +++ b/multi.c @@ -1806,7 +1806,21 @@ multi_bcast (struct multi_context *m, } #endif if (vid != 0 && vid

[Openvpn-devel] [PATCH 5/9] vlan: Add VLAN identifier to mroute_addr for ethernet addresses

2010-03-31 Thread Fabian Knittel
This patch appends the VID to the ethernet address in mroute_addr. By including the VID in mroute_addr, the routing space is divided by VLAN. This means: - duplicate MAC addresses on different VLANs no longer conflict and - all unicast-traffic is constrained to whatever VLAN the traffic came

[Openvpn-devel] [PATCH 1/9] is_ipv4(): add packet length check for 802.1Q packets

2010-03-31 Thread Fabian Knittel
This patch adds an additional length check to is_ipv4(). Currently is_ipv4() only checks whether the frame is large enough for struct openvpn_ethhdr. In case of an 802.1Q packet the function now also checks whether the frame is large enough for struct openvpn_8021qhdr, which is 4 bytes larger than