]> 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:35:32 +0000 (09:35 +0200)
commita5964e34057bd3a2c0cb232f1abc6feeefdf146e
tree7d608a74e62a7ea87d3c926099029c005f07a078
parent44e9f3933e27988193e4a0346559f53e5b876bde
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>
(cherry picked from commit 860a7bc77ef515f1d042a2860f7e2bd9980e19be)
src/openvpn/tun.c