Bug 28112 - non valid country code seems to put iw reg set command in pending
Summary: non valid country code seems to put iw reg set command in pending
Status: RESOLVED CODE_FIX
Alias: None
Product: Networking
Classification: Unclassified
Component: Wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Luis Chamberlain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-03 08:25 UTC by Gregory Alagnou
Modified: 2011-05-30 07:54 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.35.3
Subsystem:
Regression: No
Bisected commit-id:


Attachments
log trace showing iw reg set blocked by a wrong country code (16.42 KB, text/plain)
2011-02-03 08:26 UTC, Gregory Alagnou
Details
[PATCH v2] cfg80211: add work for processing invalid user reg hints (2.79 KB, patch)
2011-03-31 23:32 UTC, Luis Chamberlain
Details | Diff

Description Gregory Alagnou 2011-02-03 08:25:40 UTC
I'm using iw version 0.9.21, with linux kernel 2.6.35.3 on meego development for handset platform.
I have seen this bug with following commands:

Step 1 - set a correct country-code:
[root@localhost ~]# iw reg set JP
[root@localhost ~]# iw reg get
The result is ok.

Step 2 - set a wrong country-code:
[root@localhost ~]# iw reg set ZZ
[root@localhost ~]# iw reg get
ZZ doesn't exist in reg-db, but regulatory setting don't return an error, and when you get regulatory domain information, it's like it never change from the previous setting.

Step 3 - set a correct but different country-code:
[root@localhost ~]# iw reg set US
[root@localhost ~]# iw reg get
After the step 2, "iw reg set" command does nothing, and we can't change regulatory domain anymore...
We can repeat step 3, issue is the same after doing step 2
Comment 1 Gregory Alagnou 2011-02-03 08:26:49 UTC
Created attachment 46172 [details]
log trace showing iw reg set blocked by a wrong country code
Comment 2 John W. Linville 2011-03-29 18:30:21 UTC
I confirm the issue reported here -- Luis, can you either describe why this is or confirm that it is a bug?
Comment 3 Luis Chamberlain 2011-03-29 19:05:07 UTC
The reason this fails is that we never added a timeout value for CRDA to reply, and only CRDA will know if the country is valid. So the regulatory domain request is a setting request which gets accepted and queued. We can either change the setting to wait for CRDA to reply or else we fail. This is a change that is required, just needs to be added.
Comment 4 Luis Chamberlain 2011-03-31 23:32:48 UTC
Created attachment 52832 [details]
[PATCH v2] cfg80211: add work for processing invalid user reg hints

Subject: [PATCH v2] cfg80211: add work for processing invalid user reg hints

We have no other option but to inform userspace that we
have queued up their regulatory hint request when we are
given one given that nl80211 operates atomically on user
requests. The best we can do is accept the request, and
add a delayed work item for processing failures and cancel it
if we succeeed. Upon failure we restore the regulatory
settings and ignore the supplied user input.

This fixes this reported bug:

https://bugzilla.kernel.org/show_bug.cgi?id=28112

Reported-by: gregoryx.alagnou@intel.com
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>

---

Try this.
Comment 5 Luis Chamberlain 2011-03-31 23:33:51 UTC
Should be fixed :D
Comment 6 Florian Mickler 2011-05-30 07:54:20 UTC
A patch referencing this bug report has been merged in v3.0-rc1:

commit a90c7a313a1c5b4fc99f987a2ae8f92ab0ae35c7
Author: Luis R. Rodriguez <lrodriguez@atheros.com>
Date:   Tue Apr 5 10:49:04 2011 -0700

    cfg80211: add a timer for invalid user reg hints

Note You need to log in before you can comment on or make changes to this bug.