diff options
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo_wext.c')
-rw-r--r-- | contrib/package/iwinfo/src/iwinfo_wext.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_wext.c b/contrib/package/iwinfo/src/iwinfo_wext.c index 8fe0305f1d..7bd1574c18 100644 --- a/contrib/package/iwinfo/src/iwinfo_wext.c +++ b/contrib/package/iwinfo/src/iwinfo_wext.c @@ -89,7 +89,10 @@ static int wext_ioctl(const char *ifname, int cmd, struct iwreq *wrq) { /* 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); |