]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Platform cleanup for OpenBSD
authorGert Doering <gert@greenie.muc.de>
Sun, 5 Feb 2012 12:35:03 +0000 (13:35 +0100)
committerDavid Sommerseth <davids@redhat.com>
Wed, 8 Feb 2012 13:37:10 +0000 (14:37 +0100)
commit82d4e12068774b0a6ca787ef1345b8a16c460466
tree24def33abbe7a85c52a777092bcb3afcad0aaf22
parent003e76bc4f2401d6edfd898b298d73c0806a36d7
Platform cleanup for OpenBSD

Turn around initialization order (IFCONFIG_AFTER_TUN_OPEN) to make it
"the same as all other platforms besides Windows" (tun.h).

Remove "ifconfig destroy / ifconfig create" from open_tun() and change
to generic "create tun device by opening /dev/tunN" approach, thus
cleaning up the IFCONFIG_BEFORE_TUN_OPEN bit.

Add "-link0" for ifconfig calls in tun mode, to make sure that even if
we happen to re-use a not-cleaned-up tun interface in tap mode, it will
then be setup correctly (-link0 -> tun, link0 -> tap).

Add correct ifconfig calls for "topology subnet".

On tunnel close, only call "ifconfig destroy" if it was a tap interface
(tun + link0), because those do not auto-disappear (OpenBSD bug?)

Get rid of READV/WRITEV #ifdef's - as per the man page, these calls have
been added to 4.2BSD, and there never was an OpenBSD version without.

Tested on OpenBSD 4.9 with tun+tap, ipv4+ipv6, topology net30+subnet

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