X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/d1af7898a241c9b3a4c7e2f77fa2221ae501642b..5d94162075a9590253c8a3b6e765a57ced537769:/openwrt/target/linux/package/wlcompat/wlcompat.c diff --git a/openwrt/target/linux/package/wlcompat/wlcompat.c b/openwrt/target/linux/package/wlcompat/wlcompat.c index e96c86792..037d9ce0f 100644 --- a/openwrt/target/linux/package/wlcompat/wlcompat.c +++ b/openwrt/target/linux/package/wlcompat/wlcompat.c @@ -459,8 +459,15 @@ static int wlcompat_ioctl(struct net_device *dev, if (index < 0) index = get_primary_key(dev); - if (wrqu->data.flags & IW_ENCODE_DISABLED) + if (wrqu->data.flags & IW_ENCODE_DISABLED) { wep = 0; + if (wl_ioctl(dev, WLC_SET_WSEC, &wep, sizeof(val)) < 0) + return -EINVAL; + return 0; + } + + if (wl_ioctl(dev, WLC_SET_WSEC, &wep, sizeof(val)) < 0) + return -EINVAL; if (wrqu->data.flags & IW_ENCODE_OPEN) wrestrict = 0; @@ -479,18 +486,11 @@ static int wlcompat_ioctl(struct net_device *dev, } if (index >= 0) - if (wl_ioctl(dev, WLC_SET_KEY_PRIMARY, &index, sizeof(index)) < 0) - return -EINVAL; + wl_ioctl(dev, WLC_SET_KEY_PRIMARY, &index, sizeof(index)); - if (wl_ioctl(dev, WLC_GET_WSEC, &val, sizeof(val)) < 0) - return -EINVAL; - val |= wep; - if (wl_ioctl(dev, WLC_SET_WSEC, &val, sizeof(val)) < 0) - return -EINVAL; - if (wrestrict >= 0) - if (wl_ioctl(dev, WLC_SET_WEP_RESTRICT, &wrestrict, sizeof(wrestrict)) < 0) - return -EINVAL; + wl_ioctl(dev, WLC_SET_WEP_RESTRICT, &wrestrict, sizeof(wrestrict)); + break; } case SIOCGIWENCODE: