From 02eb92d02f4610fe587733abcaa02dd7935b3181 Mon Sep 17 00:00:00 2001 From: Henry N Date: Sun, 22 Mar 2020 14:05:24 +0100 Subject: [PATCH] Always use /dev/net/tun Always use /dev/net/tun, independent of mode TUN or TAP. A node name /dev/net/tap does not exist in default Linux kernel, see https://www.kernel.org/doc/html/v4.15/admin-guide/devices.html "200 = /dev/net/tun TAP/TUN network device" Also not exist, if the /dev/ was build with udev, or pre configured from ditribution. --- libs/asiotap/src/posix/posix_tap_adapter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/asiotap/src/posix/posix_tap_adapter.cpp b/libs/asiotap/src/posix/posix_tap_adapter.cpp index 661d6073..dee346eb 100644 --- a/libs/asiotap/src/posix/posix_tap_adapter.cpp +++ b/libs/asiotap/src/posix/posix_tap_adapter.cpp @@ -238,7 +238,7 @@ namespace asiotap m_existing_tap = !_name.empty(); #if defined(LINUX) - const std::string dev_name = (layer() == tap_adapter_layer::ethernet) ? "/dev/net/tap" : "/dev/net/tun"; + const std::string dev_name = "/dev/net/tun"; if (::access(dev_name.c_str(), F_OK) == -1) {