include $(TOPDIR)/rules.mk
PKG_NAME:=libiwinfo
-PKG_RELEASE:=3
+PKG_RELEASE:=4
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
{
/* 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);
+ }
strncpy(wrq->ifr_name, ifname, IFNAMSIZ);
#ifndef __IWINFO_MADWIFI_H_
#define __IWINFO_MADWIFI_H_
+#include <fcntl.h>
+
#include "iwinfo.h"
#include "include/madwifi.h"
static int nl80211_init(void)
{
- int err;
+ int err, fd;
if( !nls )
{
goto err;
}
+ fd = nl_socket_get_fd(nls->nl_sock);
+ if( fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC) < 0 )
+ {
+ err = -EINVAL;
+ goto err;
+ }
+
if( genl_ctrl_alloc_cache(nls->nl_sock, &nls->nl_cache)) {
err = -ENOMEM;
goto err;
remote_length = sizeof(remote.sun_family) + sprintf(remote.sun_path,
"/var/run/wpa_supplicant-%s/%s", ifname, ifname);
+ if( fcntl(sock, F_SETFD, fcntl(sock, F_GETFD) | FD_CLOEXEC) < 0 )
+ goto out;
+
if( connect(sock, (struct sockaddr *) &remote, remote_length) )
goto out;
#define __IWINFO_NL80211_H_
#include <errno.h>
+#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
{
/* 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);
+ }
if( !strncmp(ifname, "mon.", 4) )
strncpy(wrq->ifr_name, &ifname[4], IFNAMSIZ);
#ifndef __IWINFO_WEXT_H_
#define __IWINFO_WEXT_H_
+#include <fcntl.h>
+
#include "iwinfo.h"
#include "include/wext.h"
{
/* 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);
+ }
strncpy(wrq->ifr_name, ifname, IFNAMSIZ);
return ioctl(ioctl_socket, cmd, wrq);
case 0xdd: /* WPA or else */
wpa_oui = wpa1_oui;
- /* Not all IEs that start with 0xdd are WPA.
+ /* Not all IEs that start with 0xdd are WPA.
* * So check that the OUI is valid. */
if((ielen < 8) || ((memcmp(&iebuf[offset], wpa_oui, 3) != 0)
&& (iebuf[offset+3] == 0x01)))
wrq.u.data.pointer = (caddr_t) ⦥
wrq.u.data.length = sizeof(struct iw_range);
- wrq.u.data.flags = 0;
+ wrq.u.data.flags = 0;
if( wext_ioctl(ifname, SIOCGIWRANGE, &wrq) >= 0 )
{
return -1;
}
-
#ifndef __IWINFO_WEXT_SCAN_H_
#define __IWINFO_WEXT_SCAN_H_
+#include <fcntl.h>
+
#include "iwinfo.h"
#include "include/wext.h"
.header_type = IW_HEADER_TYPE_ADDR,
},
[IWEVEXPIRED - IWEVFIRST] = {
- .header_type = IW_HEADER_TYPE_ADDR,
+ .header_type = IW_HEADER_TYPE_ADDR,
},
[IWEVGENIE - IWEVFIRST] = {
.header_type = IW_HEADER_TYPE_POINT,
.max_tokens = IW_GENERIC_IE_MAX,
},
[IWEVMICHAELMICFAILURE - IWEVFIRST] = {
- .header_type = IW_HEADER_TYPE_POINT,
+ .header_type = IW_HEADER_TYPE_POINT,
.token_size = 1,
.max_tokens = sizeof(struct iw_michaelmicfailure),
},
/* 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;
#ifndef __IWINFO_WL_H_
#define __IWINFO_WL_H_
+#include <fcntl.h>
+
#include "iwinfo.h"
#include "include/broadcom.h"