Closed Bug 753612 Opened 13 years ago Closed 13 years ago

[b2g] properly close wifi connection so 3G-data can get its own route

Categories

(Core :: DOM: Device Interfaces, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: kaze, Assigned: kaze)

References

Details

Attachments

(1 file, 2 obsolete files)

Attached patch patch proposal (obsolete) (deleted) — Splinter Review
Steps to reproduce (with a b2g device): 1. disable Wi-Fi 2. enable 3G-data 3. open a page in the browser Expected result: device should be connected to the internet Actual result: no internet connection. When switching to 3G, no new route is set and the DNS are still the obsolete ones used for the wifi connection. This patch should fix it.
PS: bug 753520 should be landed before 3G connection really works.
Attachment #622591 - Flags: review?(philipp)
Blocks: b2g-3g
Depends on: 753520
Comment on attachment 622591 [details] [diff] [review] patch proposal Review of attachment 622591 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/wifi/WifiWorker.js @@ +738,4 @@ > manager.connectionInfo.bssid = null; > manager.connectionInfo.ssid = null; > manager.connectionInfo.id = -1; > + notifyStateChange({ state: "DISCONNECTED", BSSID: null, id: -1 }); In passing: this change shouldn't be needed. The rest of the WifiWorker changes look good, though.
Comment on attachment 622591 [details] [diff] [review] patch proposal I think mrbkap should review the Wifi changes.
Attachment #622591 - Flags: review?(philipp)
Attachment #622591 - Flags: review?(mrbkap)
Attachment #622591 - Flags: review+
Comment on attachment 622591 [details] [diff] [review] patch proposal Review of attachment 622591 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the change mentioned above.
Attachment #622591 - Flags: review?(mrbkap) → review+
Hmm, I realize that this patch allows to set *two* routes when both 3G and wifi are enabled. Something’s terribly wrong here. (In reply to Blake Kaplan (:mrbkap) from comment #2) > > + notifyStateChange({ state: "DISCONNECTED", BSSID: null, id: -1 }); > > In passing: this change shouldn't be needed. I confirm it works without this change.
Attached patch patch proposal (obsolete) (deleted) — Splinter Review
Now properly removing old routes and updating the default route when necessary.
Assignee: nobody → kaze
Attachment #622591 - Attachment is obsolete: true
Attachment #622969 - Flags: review?(philipp)
Attachment #622969 - Flags: review?(mrbkap)
Warning: bug 753520 *still* has to be landed before 3G connection really works.
Comment on attachment 622969 [details] [diff] [review] patch proposal Review of attachment 622969 [details] [diff] [review]: ----------------------------------------------------------------- Nice work! Just a nit below about code flow/readability. Wifi parts haven't changed since the previous version that mrbkap already r+'ed, so I'm clearing that flag. ::: dom/system/gonk/NetworkManager.js @@ +186,2 @@ > if (this.active.dhcp) { > + options = { cmd: "runDHCPAndSetDefaultRouteAndDNS", ifname: this.active.name }; Nit: s/var/let, move `ifname` definition into `options`, assume a default for `cmd`, and don't overwrite it with a new obj: let options = {cmd: "setDefaultRouteAndDNS", ifname: this.active.name}; if (this.active.dhcp) { options.cmd = "runDHCPAndSetDefaultRouteAndDNS"; } if (oldInterface) { options.oldIfname = oldInterface.name; } or even more concise: let options = { cmd: this.active.dhcp ? "runDHCPAndSetDefaultRouteAndDNS" : "setDefaultRouteAndDNS", ifname: this.active.name, oldIfname: oldInterface ? oldInterface.name : null }
Attachment #622969 - Flags: review?(philipp)
Attachment #622969 - Flags: review?(mrbkap)
Attachment #622969 - Flags: review+
Attached patch patch proposal (deleted) — Splinter Review
same patch with a less ugly code. I’ve just found out that the initial conditions might still cause issues (e.g. when the 3G is enabled at startup, it has to be disabled/enabled to work properly). I’ll fill a follow-up.
Attachment #622969 - Attachment is obsolete: true
follow-up: bug 754152
Attachment #622997 - Flags: checkin+
Target Milestone: --- → mozilla15
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: