diff options
author | Felix Fietkau <nbd@openwrt.org> | 2005-07-04 18:22:07 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2005-07-04 18:22:07 +0000 |
commit | e9434f579c115308c0ae87dbfb70aa5f53150931 (patch) | |
tree | 1a76dbd2ac79479a2b4c89d473de066e82221a93 /package | |
parent | 122220eb0d327f8af95a13123a546f06c3b4cd51 (diff) | |
download | upstream-e9434f579c115308c0ae87dbfb70aa5f53150931.tar.gz upstream-e9434f579c115308c0ae87dbfb70aa5f53150931.tar.bz2 upstream-e9434f579c115308c0ae87dbfb70aa5f53150931.zip |
fix setting gmode, when wl0_gmode is unset
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1336 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r-- | package/wificonf/wificonf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/package/wificonf/wificonf.c b/package/wificonf/wificonf.c index 79606a895d..519596c197 100644 --- a/package/wificonf/wificonf.c +++ b/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")) { |