Another TUN driver fix from Max Neklyudov
This commit is contained in:
parent
2a81a76c33
commit
622c5c9aa6
2
arch
2
arch
|
@ -1 +1 @@
|
||||||
Subproject commit 29f7043bc649460e709f191fca47a0a026a50adb
|
Subproject commit 76efd5e60a14c9e3b312b6f11c7c67de972a8299
|
|
@ -1189,7 +1189,7 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||||
int intf;
|
int intf;
|
||||||
FAR struct ifreq *ifr = (FAR struct ifreq*)arg;
|
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;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -1220,7 +1220,6 @@ static int tun_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||||
|
|
||||||
priv = filep->f_priv;
|
priv = filep->f_priv;
|
||||||
strncpy(ifr->ifr_name, priv->dev.d_ifname, IFNAMSIZ);
|
strncpy(ifr->ifr_name, priv->dev.d_ifname, IFNAMSIZ);
|
||||||
lldbg("--- %s\n", priv->dev.d_ifname);
|
|
||||||
|
|
||||||
tundev_unlock(tun);
|
tundev_unlock(tun);
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@
|
||||||
|
|
||||||
#define IFF_TUN 0x01
|
#define IFF_TUN 0x01
|
||||||
#define IFF_TAP 0x02
|
#define IFF_TAP 0x02
|
||||||
|
#define IFF_MASK 0x7f
|
||||||
#define IFF_NO_PI 0x80
|
#define IFF_NO_PI 0x80
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue