diff options
author | Felix Fietkau <nbd@openwrt.org> | 2005-06-27 09:08:02 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2005-06-27 09:08:02 +0000 |
commit | 8523556e0f0a6fae48a38ce5d102136a03662c47 (patch) | |
tree | baed5450da6a6e657991088c263292637518ba89 /openwrt | |
parent | 6cc748b3c67ab67aad15e0e8f0b6378cf8c8cc35 (diff) | |
download | mtk-20170518-8523556e0f0a6fae48a38ce5d102136a03662c47.zip mtk-20170518-8523556e0f0a6fae48a38ce5d102136a03662c47.tar.gz mtk-20170518-8523556e0f0a6fae48a38ce5d102136a03662c47.tar.bz2 |
fix wds in wificonf
SVN-Revision: 1288
Diffstat (limited to 'openwrt')
-rw-r--r-- | openwrt/package/wificonf/wificonf.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/openwrt/package/wificonf/wificonf.c b/openwrt/package/wificonf/wificonf.c index 21a96c4..8df932f 100644 --- a/openwrt/package/wificonf/wificonf.c +++ b/openwrt/package/wificonf/wificonf.c @@ -146,6 +146,8 @@ int bcom_set_int(int skfd, char *ifname, char *var, int val) void setup_bcom(int skfd, char *ifname) { int val = 0; + char buf[8192]; + char wbuf[80]; char *v; if (bcom_ioctl(skfd, ifname, WLC_GET_MAGIC, &val, sizeof(val)) < 0) @@ -225,8 +227,6 @@ void setup_bcom(int skfd, char *ifname) val = WLC_MACMODE_DISABLED; if ((val != WLC_MACMODE_DISABLED) && (v = nvram_get(wl_var("maclist")))) { - char buf[8192]; - char wbuf[80]; struct maclist *mac_list; struct ether_addr *addr; char *next; @@ -235,7 +235,7 @@ void setup_bcom(int skfd, char *ifname) mac_list = (struct maclist *) buf; addr = mac_list->ea; - foreach(wbuf, nvram_safe_get(wl_var("maclist")), next) { + foreach(wbuf, v, next) { if (ether_atoe(wbuf, addr->ether_addr_octet)) { mac_list->count++; addr++; @@ -246,6 +246,21 @@ void setup_bcom(int skfd, char *ifname) val = WLC_MACMODE_DISABLED; } bcom_ioctl(skfd, ifname, WLC_SET_MACMODE, &val, sizeof(val)); + + if (v = nvram_get(wl_var("wds"))) { + struct maclist *wdslist = (struct maclist *) buf; + struct ether_addr *addr = wdslist->ea; + char *next; + + memset(buf, 0, 8192); + foreach(wbuf, v, next) { + if (ether_atoe(wbuf, addr->ether_addr_octet)) { + wdslist->count++; + addr++; + } + } + bcom_ioctl(skfd, ifname, WLC_SET_WDSLIST, buf, sizeof(buf)); + } /* Set up G mode */ bcom_ioctl(skfd, ifname, WLC_GET_PHYTYPE, &val, sizeof(val)); |