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 | 514eef8415b1d3508b6acb0ce9d78bd532eb66da (patch) | |
tree | 1b2af29ea531b25e9c1641e2edd4031652bf201b | |
parent | d26d551aa50fbf28a39ab7d254d438e7ea88c132 (diff) | |
download | mtk-20170518-514eef8415b1d3508b6acb0ce9d78bd532eb66da.zip mtk-20170518-514eef8415b1d3508b6acb0ce9d78bd532eb66da.tar.gz mtk-20170518-514eef8415b1d3508b6acb0ce9d78bd532eb66da.tar.bz2 |
fix setting gmode, when wl0_gmode is unset
SVN-Revision: 1336
-rw-r--r-- | openwrt/package/wificonf/wificonf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openwrt/package/wificonf/wificonf.c b/openwrt/package/wificonf/wificonf.c index 79606a8..519596c 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")) { |