diff options
author | Hamish Guthrie <hcg@openwrt.org> | 2012-07-19 08:36:11 +0000 |
---|---|---|
committer | Hamish Guthrie <hcg@openwrt.org> | 2012-07-19 08:36:11 +0000 |
commit | c743275c3b0b2a6a88206dae6949b8e91b8a0c69 (patch) | |
tree | fdc54f5f0b6b5909079b2cfc625ba4254f98c571 /package/wireless-tools | |
parent | 31406b79a5a7ca5bb6d2e5ce545774e667c771fb (diff) | |
download | upstream-c743275c3b0b2a6a88206dae6949b8e91b8a0c69.tar.gz upstream-c743275c3b0b2a6a88206dae6949b8e91b8a0c69.tar.bz2 upstream-c743275c3b0b2a6a88206dae6949b8e91b8a0c69.zip |
Increase iwlist buffer size
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@32777 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/wireless-tools')
-rw-r--r-- | package/wireless-tools/Makefile | 2 | ||||
-rw-r--r-- | package/wireless-tools/patches/004-increase_iwlist_buffer.patch | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/package/wireless-tools/Makefile b/package/wireless-tools/Makefile index 31047c4c67..d553d4b176 100644 --- a/package/wireless-tools/Makefile +++ b/package/wireless-tools/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wireless-tools PKG_VERSION:=29 PKG_MINOR:= -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=wireless_tools.$(PKG_VERSION)$(PKG_MINOR).tar.gz PKG_SOURCE_URL:=http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux diff --git a/package/wireless-tools/patches/004-increase_iwlist_buffer.patch b/package/wireless-tools/patches/004-increase_iwlist_buffer.patch new file mode 100644 index 0000000000..f2fdb124e6 --- /dev/null +++ b/package/wireless-tools/patches/004-increase_iwlist_buffer.patch @@ -0,0 +1,46 @@ +--- a/iwlist.c ++++ b/iwlist.c +@@ -792,7 +792,8 @@ print_scanning_info(int skfd, + if(iw_get_ext(skfd, ifname, SIOCGIWSCAN, &wrq) < 0) + { + /* Check if buffer was too small (WE-17 only) */ +- if((errno == E2BIG) && (range.we_version_compiled > 16)) ++ if((errno == E2BIG) && (range.we_version_compiled > 16) ++ && (buflen < 0xFFFF)) + { + /* Some driver may return very large scan results, either + * because there are many cells, or because they have many +@@ -808,6 +809,10 @@ print_scanning_info(int skfd, + else + buflen *= 2; + ++ /* wrq.u.data.length is 16 bits so max size is 65535 */ ++ if(buflen > 0xFFFF) ++ buflen = 0xFFFF; ++ + /* Try again */ + goto realloc; + } +@@ -2152,6 +2157,7 @@ main(int argc, + char **args; /* Command arguments */ + int count; /* Number of arguments */ + const iwlist_cmd *iwcmd; ++ int goterr = 0; + + if(argc < 2) + iw_usage(1); +@@ -2199,12 +2205,12 @@ main(int argc, + + /* do the actual work */ + if (dev) +- (*iwcmd->fn)(skfd, dev, args, count); ++ goterr = (*iwcmd->fn)(skfd, dev, args, count); + else + iw_enum_devices(skfd, iwcmd->fn, args, count); + + /* Close the socket. */ + iw_sockets_close(skfd); + +- return 0; ++ return goterr; + } |