diff --git a/arch b/arch index 29f7043bc6..76efd5e60a 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 29f7043bc649460e709f191fca47a0a026a50adb +Subproject commit 76efd5e60a14c9e3b312b6f11c7c67de972a8299 diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 507678c7c1..d804eea2cb 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1178,8 +1178,8 @@ errout: static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { - FAR struct inode *inode = filep->f_inode; - FAR struct tun_driver_s *tun = inode->i_private; + FAR struct inode *inode = filep->f_inode; + FAR struct tun_driver_s *tun = inode->i_private; FAR struct tun_device_s *priv = filep->f_priv; int ret = OK; @@ -1189,7 +1189,7 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg) int intf; FAR struct ifreq *ifr = (FAR struct ifreq*)arg; - if (!ifr || ifr->ifr_flags != IFF_TUN) + if (!ifr || (ifr->ifr_flags & IFF_MASK) != IFF_TUN) { return -EINVAL; } @@ -1220,7 +1220,6 @@ 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); - lldbg("--- %s\n", priv->dev.d_ifname); tundev_unlock(tun); diff --git a/include/nuttx/net/tun.h b/include/nuttx/net/tun.h index 3db395f170..c61c3c84f4 100644 --- a/include/nuttx/net/tun.h +++ b/include/nuttx/net/tun.h @@ -58,6 +58,7 @@ #define IFF_TUN 0x01 #define IFF_TAP 0x02 +#define IFF_MASK 0x7f #define IFF_NO_PI 0x80 /****************************************************************************