]> git.ipfire.org Git - thirdparty/openvpn.git/commit
FreeBSD DCO: introduce real subnet mode
authorGert Doering <gert@greenie.muc.de>
Wed, 12 Oct 2022 14:59:15 +0000 (16:59 +0200)
committerGert Doering <gert@greenie.muc.de>
Wed, 19 Oct 2022 07:28:28 +0000 (09:28 +0200)
commit22bc63c78439ed23b974b8f822330d75ec79c7fc
treedbb0b7966b84c1c97ec9790ff629c10ffe0b4c6a
parent94db32616597497e57eb2fa6fab05297da314a53
FreeBSD DCO: introduce real subnet mode

To be able to configure a FreeBSD interface to "subnet" mode
(as opposed to point-to-point mode), it needs to have its
if_iflags set to IFF_BROADCAST.  For tun(4) interface this is
done with the TUNSIFMODE ioctl(), but this does not work for
more modern interfaces like ovpn(4) which communicate over
a common SIOCSDRVSPEC ioctl() that contains a "cmd" and a
"parameter list".

Introduce OVPN_SET_IFMODE cmd, add dco_set_ifmode() function
to put kernel interface into IFF_BROADCAST or IFF_POINTOPOINT
as needed.

NOTE: this needs a FreeBSD kernel that includes commit 2e797555f701c38d9d
to add the OVPN_SET_IFMODE on the kernel side - with an older kernel,
OpenVPN + ovpn(4) will log an error, and "topology subnet" setups
will not work.

Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Kristof Provost <kprovost@netgate.com>
Message-Id: <20221012145915.25810-2-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg25395.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/dco_freebsd.c
src/openvpn/ovpn_dco_freebsd.h