always reset the wds list in wificonf (#808)
authorFelix Fietkau <nbd@openwrt.org>
Wed, 4 Oct 2006 21:38:32 +0000 (21:38 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 4 Oct 2006 21:38:32 +0000 (21:38 +0000)
SVN-Revision: 4919

openwrt/package/wificonf/wificonf.c

index 401e9049fdc26c909b846695aeee4175c4085e26..d045ad71f7c1b78a3ad2d72a4461b25b8aa20692 100644 (file)
@@ -200,12 +200,12 @@ static int setup_bcom_wds(int skfd, char *ifname)
        char *v;
        int wds_enabled = 0;
 
+       memset(buf, 0, 8192);
        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++;
@@ -213,8 +213,9 @@ static int setup_bcom_wds(int skfd, char *ifname)
                                wds_enabled = 1;
                        }
                }
-               bcom_ioctl(skfd, ifname, WLC_SET_WDSLIST, buf, sizeof(buf));
        }
+       bcom_ioctl(skfd, ifname, WLC_SET_WDSLIST, buf, sizeof(buf));
+
        return wds_enabled;
 }