Commit a58ecb38 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

tun/kerndat: Keep going with CONFIG_TUN=n

check_tun_netns_cr() should return 0 on CONFIG_TUN=n kernels.
That is, when we fail to open tun device.

Fixes: #496
Signed-off-by: 's avatarDmitry Safonov <dima@arista.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 9462f2ae
......@@ -74,17 +74,18 @@ int check_tun_cr(int no_tun_err)
int check_tun_netns_cr(bool *result)
{
bool val;
bool val = false;
int tun;
tun = open(TUN_DEV_GEN_PATH, O_RDONLY);
if (tun < 0) {
pr_perror("Unable to create tun");
return -1;
goto out;
}
check_has_netns_ioc(tun, &val, "tun");
close(tun);
out:
if (result)
*result = val;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment