]> git.ipfire.org Git - thirdparty/openvpn.git/commit
Adjust Linux+FreeBSD DCO device name handling to 'non DCO linux style'
authorGert Doering <gert@greenie.muc.de>
Mon, 29 Aug 2022 19:01:24 +0000 (21:01 +0200)
committerGert Doering <gert@greenie.muc.de>
Tue, 30 Aug 2022 19:55:19 +0000 (21:55 +0200)
commita5cf4cfb77f74588759d96258e7435e54db12b2c
tree019ff21f7d579e25b62e1c86cce3a1d860fff291
parent26d619277284f346f1d45c15bf0bbbdbda4a99f9
Adjust Linux+FreeBSD DCO device name handling to 'non DCO linux style'

On Linux, tun devices are created according to the following algorithm
  --dev tun    -> try tun0, tun1, ... tun255, use first free
  --dev anything -> create a TUN device named "anything"
(as long as "anything" is not "null" or "tap[N]")

DCO was following the "other platform convention", where everything
not having a digit was iterated ("--dev tun-home" -> "tun-home0") -
which does not work for classic tun/tap devices on the BSDs anyway,
so is not the best model.

Adjust open_tun_dco_generic() to document expected behaviour and
do the thing.

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