allow netlink interface in driver check
@@ -4958,7 +4958,7 @@ if(ioctl(fd_socket, SIOCGIWMODE, &iwr_old) < 0)
return false;
}
-if((iwr.u.mode & IW_MODE_MONITOR) != IW_MODE_MONITOR)
+if((iwr_old.u.mode & IW_MODE_MONITOR) != IW_MODE_MONITOR)
{
memset(&ifr, 0, sizeof(ifr));
strncpy( ifr.ifr_name, interfacename, IFNAMSIZ -1);
@@ -5008,7 +5008,7 @@ if((iwr.u.mode & IW_MODE_MONITOR) != IW_MODE_MONITOR)
return false;
}
- if((ifr.ifr_flags & (IFF_UP | IFF_RUNNING | IFF_BROADCAST)) != (IFF_UP | IFF_RUNNING | IFF_BROADCAST))
+ if((ifr.ifr_flags & (IFF_UP)) != (IFF_UP))
{
fprintf(stderr, "interface may not be operational\n");
return false;
@@ -5110,6 +5110,8 @@ if(ioctl(fd_socket, SIOCGIWMODE, &iwr_old) < 0)
drivererrorflag = true;
}
+if((iwr_old.u.mode & IW_MODE_MONITOR) != IW_MODE_MONITOR)
+ {
memset(&ifr, 0, sizeof(ifr));
strncpy( ifr.ifr_name, interfacename, IFNAMSIZ -1);
if(ioctl(fd_socket, SIOCSIFFLAGS, &ifr) < 0)
@@ -5157,11 +5159,16 @@ if(ioctl(fd_socket, SIOCGIFFLAGS, &ifr) < 0)
drivererrorflag = true;
}
-if((ifr.ifr_flags & (IFF_UP | IFF_RUNNING | IFF_BROADCAST)) != (IFF_UP | IFF_RUNNING | IFF_BROADCAST))
+ if((ifr.ifr_flags & (IFF_UP)) != (IFF_UP))
{
fprintf(stderr, "ioctl(SIOCGIFFLAGS) - IFF_UP | IFF_RUNNING | IFF_BROADCAST failed\n");
drivererrorflag = true;
}
+ }
+else
+ {
+ fprintf(stderr,"interface is already in monitor mode - we skip some tests\n");
+ }
memset(&ifr, 0, sizeof(ifr));
strncpy( ifr.ifr_name, interfacename, IFNAMSIZ -1);
