projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libiwinfo: move duplicated coded into iwinfo_utils.[ch]
[project/luci.git]
/
contrib
/
package
/
iwinfo
/
src
/
iwinfo_wl.c
diff --git
a/contrib/package/iwinfo/src/iwinfo_wl.c
b/contrib/package/iwinfo/src/iwinfo_wl.c
index
a08dcd2
..
1691e4b
100644
(file)
--- a/
contrib/package/iwinfo/src/iwinfo_wl.c
+++ b/
contrib/package/iwinfo/src/iwinfo_wl.c
@@
-21,28
+21,20
@@
#include "iwinfo_wl.h"
#include "iwinfo_wext.h"
#include "iwinfo_wl.h"
#include "iwinfo_wext.h"
-static int ioctl_socket = -1;
-
static int wl_ioctl(const char *name, int cmd, void *buf, int len)
{
struct ifreq ifr;
wl_ioctl_t ioc;
static int wl_ioctl(const char *name, int cmd, void *buf, int len)
{
struct ifreq ifr;
wl_ioctl_t ioc;
- /* 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;
ioc.buf = buf;
ioc.len = len;
/* do it */
ioc.cmd = cmd;
ioc.buf = buf;
ioc.len = len;
+
strncpy(ifr.ifr_name, name, IFNAMSIZ);
ifr.ifr_data = (caddr_t) &ioc;
strncpy(ifr.ifr_name, name, IFNAMSIZ);
ifr.ifr_data = (caddr_t) &ioc;
- return i
octl(ioctl_socket,
SIOCDEVPRIVATE, &ifr);
+ return i
winfo_ioctl(
SIOCDEVPRIVATE, &ifr);
}
static struct wl_maclist * wl_read_assoclist(const char *ifname)
}
static struct wl_maclist * wl_read_assoclist(const char *ifname)
@@
-77,8
+69,7
@@
int wl_probe(const char *ifname)
void wl_close(void)
{
void wl_close(void)
{
- if( ioctl_socket > -1 )
- close(ioctl_socket);
+ /* Nop */
}
int wl_get_mode(const char *ifname, char *buf)
}
int wl_get_mode(const char *ifname, char *buf)