summaryrefslogtreecommitdiff
path: root/openwrt/package/wificonf
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-07-04 18:22:07 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-07-04 18:22:07 +0000
commite82b98c8f442e4f9474c0b8b453d37063111301f (patch)
tree1b2af29ea531b25e9c1641e2edd4031652bf201b /openwrt/package/wificonf
parent8d6baf0057572fba7f20c4824918fcbebc86edc5 (diff)
fix setting gmode, when wl0_gmode is unset
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1336 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/package/wificonf')
-rw-r--r--openwrt/package/wificonf/wificonf.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/openwrt/package/wificonf/wificonf.c b/openwrt/package/wificonf/wificonf.c
index 79606a895d..519596c197 100644
--- a/openwrt/package/wificonf/wificonf.c
+++ b/openwrt/package/wificonf/wificonf.c
@@ -270,9 +270,14 @@ void setup_bcom(int skfd, char *ifname)
int override = WLC_G_PROTECTION_OFF;
int control = WLC_G_PROTECTION_CTL_OFF;
- val = atoi(nvram_safe_get(wl_var("gmode")));
+ if (v = nvram_get(wl_var("gmode")))
+ val = atoi(v);
+ else
+ val = 1;
+
if (val > 5)
val = 1;
+
bcom_ioctl(skfd, ifname, WLC_SET_GMODE, &val, sizeof(val));
if (nvram_match(wl_var("gmode_protection"), "auto")) {