]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Workaround FreeBSD 12+ race condition on tun/tap open with IPv6.
authorGert Doering <gert@greenie.muc.de>
Thu, 23 Jul 2020 12:19:49 +0000 (14:19 +0200)
committerGert Doering <gert@greenie.muc.de>
Sun, 23 Aug 2020 20:09:45 +0000 (22:09 +0200)
commit5e19cc2c1bf22d44f10dc585ba69d48951dc7a86
treea043c04266e44822e065f247a77afe15e2272801
parent10abd656a3ae279cea7344055ce23637b7a62f6b
Workaround FreeBSD 12+ race condition on tun/tap open with IPv6.

On FreeBSD 12 (tested and verified on 12.1-RELEASE-p2), after "ifconfig
inet6" for a tun/tap interface, there sometimes is a race condition
where the "IFDISABLED" flag shows up after a short time frame, under
a second, and never clears itself.  This disables use of the configured
IPv6 address on the interface, breaking IPv6 over tun/tap operation.

This only happens if ipv6_activate_all_interfaces="YES" is not
set in /etc/rc.conf - but there might be reasons why this is not so.

As a workaround until this can be fixed on the FreeBSD side (or a
better workaround is found), sleep(1) after ifconfig, then call
"ifconfig $dev inet6 -ifdisable".

Yes, this is massively ugly but makes the problem completely go
away for my test systems.

(The same effect can be achieved with an --up script that does this,
but it's even less pretty - see trac ticket)

FreeBSD: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=248172

v2: reword text, refer to FreeBSD bug with much more details

Trac: 1226
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Arne Schwabe <arne@rfc2549.org>
Message-Id: <20200723121949.78223-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20553.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c