summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/iwinfo/src/iwinfo_madwifi.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-10-03 18:32:29 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-10-03 18:32:29 +0000
commit2c9b1c4a1b74271fd149ea0035cec1acf9754966 (patch)
tree005885bd00de1edefd2d9ae89beeb74694b099c3 /contrib/package/iwinfo/src/iwinfo_madwifi.c
parente3570b7b0d04205b53f45c8e6ad29379fb2674db (diff)
[libiwinfo] apply FD_CLOEXEC on internal ioctl and netlink sockets
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo_madwifi.c')
-rw-r--r--contrib/package/iwinfo/src/iwinfo_madwifi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_madwifi.c b/contrib/package/iwinfo/src/iwinfo_madwifi.c
index 9b761edfaf..daecf5df3d 100644
--- a/contrib/package/iwinfo/src/iwinfo_madwifi.c
+++ b/contrib/package/iwinfo/src/iwinfo_madwifi.c
@@ -202,7 +202,10 @@ static int madwifi_ioctl(struct iwreq *wrq, const char *ifname, int cmd, void *d
{
/* 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);