From: Felix Fietkau Date: Mon, 4 Jul 2005 18:22:07 +0000 (+0000) Subject: fix setting gmode, when wl0_gmode is unset X-Git-Url: http://207.154.207.93/?a=commitdiff_plain;h=d08cb5f27ec9cfc9e71f165a4f17fb4a52b073e0;p=15.05%2Fopenwrt.git fix setting gmode, when wl0_gmode is unset git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1336 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- 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")) {