From db344197d4231ef48653ffe0045d117fdb815ba8 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Sun, 8 Oct 2017 09:55:49 +0200 Subject: [PATCH] added warning on native when not running sudo / not able to allocate tun --- arch/cpu/native/net/tun6-net.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/cpu/native/net/tun6-net.c b/arch/cpu/native/net/tun6-net.c index 0fbf682d3..231e403cb 100644 --- a/arch/cpu/native/net/tun6-net.c +++ b/arch/cpu/native/net/tun6-net.c @@ -51,7 +51,7 @@ #include -#define DEBUG DEBUG_FULL +#define DEBUG DEBUG_NONE #include "net/ipv6/uip-debug.h" #ifdef linux @@ -209,7 +209,9 @@ tun_init() tunfd = tun_alloc(config_tundev); if(tunfd == -1) { - err(1, "failed to allocate tun device ``%s''", config_tundev); + printf("Warning: can't allocate tun device when not in sudo - Native platform will run but without network.\n"); + /* err(1, "failed to allocate tun device ``%s''", config_tundev); */ + return; } PRINTF("Tun open:%d\n", tunfd);