summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/iwinfo/src
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-09-29 08:27:16 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-09-29 08:27:16 +0000
commite3570b7b0d04205b53f45c8e6ad29379fb2674db (patch)
treee3c885fd40f11573429ca18ac6c1e8057a7b5318 /contrib/package/iwinfo/src
parentb1484bf49e5fbf6627f53eadf977fca44d95fec9 (diff)
[libiwinfo] fixup ccode in wl_get_country()
Diffstat (limited to 'contrib/package/iwinfo/src')
-rw-r--r--contrib/package/iwinfo/src/iwinfo_wl.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_wl.c b/contrib/package/iwinfo/src/iwinfo_wl.c
index 1a7d586d9..2dac12b1a 100644
--- a/contrib/package/iwinfo/src/iwinfo_wl.c
+++ b/contrib/package/iwinfo/src/iwinfo_wl.c
@@ -482,8 +482,23 @@ int wl_get_freqlist(const char *ifname, char *buf, int *len)
int wl_get_country(const char *ifname, char *buf)
{
- if( !wl_ioctl(ifname, WLC_GET_COUNTRY, buf, WLC_CNTRY_BUF_SZ) )
+ char ccode[WLC_CNTRY_BUF_SZ];
+
+ if( !wl_ioctl(ifname, WLC_GET_COUNTRY, ccode, WLC_CNTRY_BUF_SZ) )
+ {
+ /* IL0 -> World */
+ if( !strcmp(ccode, "IL0") )
+ sprintf(buf, "00");
+
+ /* YU -> RS */
+ else if( !strcmp(ccode, "YU") )
+ sprintf(buf, "RS");
+
+ else
+ memcpy(buf, ccode, 2);
+
return 0;
+ }
return -1;
}