Skip to content

Commit

Permalink
Always use /dev/net/tun
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
HenryNe authored Mar 22, 2020
1 parent 4bfe5a7 commit 02eb92d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/asiotap/src/posix/posix_tap_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 02eb92d

Please sign in to comment.