/* prepare socket */
if( ioctl_socket == -1 )
+ {
ioctl_socket = socket(AF_INET, SOCK_DGRAM, 0);
+ fcntl(ioctl_socket, F_SETFD, fcntl(ioctl_socket, F_GETFD) | FD_CLOEXEC);
+ }
/* do it */
ioc.cmd = cmd;
return 0;
}
+void wl_close(void)
+{
+ if( ioctl_socket > -1 )
+ close(ioctl_socket);
+}
+
int wl_get_mode(const char *ifname, char *buf)
{
int ret = -1;