From 30c51a49a594bd5fbc3c7d623f9d5914460acb99 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 20 Aug 2017 12:00:12 -0600 Subject: [PATCH] drivers/net/tun.c: Currently cannot support TAP mode unless Ethenet is enabled --- drivers/net/tun.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index d127ae5e5b..1bef4351cc 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1224,6 +1224,7 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg) priv = filep->f_priv; strncpy(ifr->ifr_name, priv->dev.d_ifname, IFNAMSIZ); +#ifdef CONFIG_NET_ETHERNET if ((ifr->ifr_flags & IFF_MASK) == IFF_TAP) { /* TAP device -> handling raw Ethernet packets @@ -1233,6 +1234,7 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg) priv->dev.d_llhdrlen = ETH_HDRLEN; } else if ((ifr->ifr_flags & IFF_MASK) == IFF_TUN) +#endif { /* TUN device -> handling an application data stream * -> no header