]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Fix combination of --dev tap and --topology subnet across multiple platforms.
authorGert Doering <gert@greenie.muc.de>
Mon, 14 Sep 2020 07:08:43 +0000 (09:08 +0200)
committerGert Doering <gert@greenie.muc.de>
Fri, 18 Sep 2020 07:34:30 +0000 (09:34 +0200)
commit860a7bc77ef515f1d042a2860f7e2bd9980e19be
treeb5e2d84af0964450fdfa67db97b16f9e9df08045
parent94cebf8261d20a55b0260cce61ad892a98bc24d8
Fix combination of --dev tap and --topology subnet across multiple platforms.

--topology should have no effect in tap mode (tap is always "subnet"),
but due to the way options are checked, setting "topology subnet" caught
an improper branch on all non-linux and non-win32 platforms.

Easily tested by adding "--topology subnet" to a "--dev tap" t_client
test.

Tested, verified, and fixed on FreeBSD 13.3, NetBSD 8.1, OpenBSD 6.5,
OpenIndiana 2019 (Solaris) and MacOS X Mojave.

This is a forward-port of commit 6c13e24e5709 - the original intent
for "master" was to restructure tun.c in a larger way and clean up
these if() blocks more nicely... which has not happened yet, so this
patch is basically applying exactly the same changes to context that
has changed too much for git to be able to do this automatically.

Trac: #1085

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Antonio Quartulli <a@unstable.cc>
Message-Id: <20200914070843.51678-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg20987.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/tun.c