Closed Bug 834573 Opened 8 years ago Closed 8 years ago

B2G Wifi: IP and default route still exist after forget network

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:leo+, firefox22 wontfix, firefox23 wontfix, firefox24 fixed, b2g18 verified, b2g18-v1.0.0 wontfix, b2g18-v1.0.1 wontfix, b2g-v1.1hd fixed)

RESOLVED FIXED
1.1 QE5
blocking-b2g leo+
Tracking Status
firefox22 --- wontfix
firefox23 --- wontfix
firefox24 --- fixed
b2g18 --- verified
b2g18-v1.0.0 --- wontfix
b2g18-v1.0.1 --- wontfix
b2g-v1.1hd --- fixed

People

(Reporter: swu, Assigned: dimi)

References

Details

Attachments

(1 file, 1 obsolete file)

STR:
1. Connect to a wifi network
2. Click 'Forget' to disconnect from that network
3. Check IP and default route of wlan0 by:
  $ adb shell cat /proc/net/route
  $ adb shell netcfg

Expected:
IP and default route of wlan0 interface should be removed

Actual:
IP and default route of wlan0 interface still exist

Incorrect default route information could lead to other problems when we have 3G data call enabled at the same time.
Assignee: nobody → dlee
Attached patch possible fix for bug 834573 v1 (obsolete) — Splinter Review
bug_834573_v1.patch do not include 3g network testing
Attachment #742252 - Flags: feedback?(vchang)
Comment on attachment 742252 [details] [diff] [review]
possible fix for bug 834573 v1

Review of attachment 742252 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/system/gonk/NetworkManager.js
@@ +446,5 @@
>        if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE) {
>          defaultDataNetwork = network;
>        }
>        this.active = network;
> +      this._activeNetworkInfo = JSON.parse(JSON.stringify(network));

I would suggest to copy what you want this way. 
{obj1.a, obj1.b, obj1.c} = {obj2.a, obj2.b, obj2.c};

::: dom/wifi/WifiWorker.js
@@ +799,5 @@
>  
>    manager.connectionDropped = function(callback) {
> +    // Reset network interface when connection drop
> +    configureInterface(manager.ifname, 0, 0, 0, 0, 0, function (data) {
> +    });

Why do we need this here ?
Attachment #742252 - Flags: feedback?(vchang)
Attachment #744552 - Flags: feedback?(vchang)
Comment on attachment 744552 [details] [diff] [review]
possible fix for bug 834573 v2

Review of attachment 744552 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, thank you.
Attachment #744552 - Flags: feedback?(vchang) → feedback+
Comment on attachment 744552 [details] [diff] [review]
possible fix for bug 834573 v2

This is ready to land patch, remark as r+.
Attachment #744552 - Flags: feedback+ → review+
Are we going to land this bug?
Keywords: checkin-needed
Attachment #742252 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/4dd6f2744682
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
blocking-b2g: --- → leo?
Duplicate of this bug: 903157
Since this was present in v1.0.1, I don't think it meets our blocking criteria for v1.1.
Pulling nom per comment 10
blocking-b2g: leo? → ---
Re-requesting Leo nomination as this is blocking a requested feature for the Leo customer.

I have tested this fix to ensure it resolves our use case on b2g18.
blocking-b2g: --- → leo?
(In reply to pgravel from comment #12)
> Re-requesting Leo nomination as this is blocking a requested feature for the
> Leo customer.

Please email ffos-product@mozilla.org with justification. You have not provided any context for this request, as I see no associated leo+ feature bug.
blocking-b2g: leo? → -
This bug causes GPS to fail when there's a switch from wifi to data.  It is a blocker for us, detected during internal field trials. Regarding comment 10, this bug did not matter on v1.0.1 for GPS, but the GPS implementation was completely revamped in v1.1.
blocking-b2g: - → leo+
Verified fixed on Leo Device

Build ID: 20130819041202
Gecko: http://hg.mozilla.org/releases/mozilla-b2g18/rev/285e2afe2a3b
Gaia: 124ed9737f0f44781cb75f763468f1574f753ac0
Platform Version: 18.1
RIL Version: 01.01.00.019.196 

After forgetting network the ip address and default route no longer show
Hi all,

When connect with network via 3G, turn on/off wifi(Not connect AP), it will disconnect 3G. So need add a judgment condition before call resetRoutingTable.

          case Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED:
            // Remove host route for data calls
            if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE ||
                network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS ||
                network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) {
              this.removeHostRoute(network);
            }
            // Remove routing table in /proc/net/route
            if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
              if (this._activeInfo.name == DEFAULT_WIFI_INTERFACE_NAME) {//add judgment
                 this.resetRoutingTable(this._activeInfo);
Hi Dimi, can you help to check comment 18 ?
Flags: needinfo?(dlee)
Hi all,
  This issue is fixed is bug 888828.
  The patch is quite simple, only change 

      this.resetRoutingTable(this._activeInfo);   to   this.resetRoutingTable(network);

  You can merge the patch to fix this issue, thanks
Flags: needinfo?(dlee)
(In reply to Guoqiang.CHEN from comment #18)
> Hi all,
> 
> When connect with network via 3G, turn on/off wifi(Not connect AP), it will
> disconnect 3G. So need add a judgment condition before call
> resetRoutingTable.
> 
>           case Ci.nsINetworkInterface.NETWORK_STATE_DISCONNECTED:
>             // Remove host route for data calls
>             if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE ||
>                 network.type ==
> Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_MMS ||
>                 network.type ==
> Ci.nsINetworkInterface.NETWORK_TYPE_MOBILE_SUPL) {
>               this.removeHostRoute(network);
>             }
>             // Remove routing table in /proc/net/route
>             if (network.type == Ci.nsINetworkInterface.NETWORK_TYPE_WIFI) {
>               if (this._activeInfo.name == DEFAULT_WIFI_INTERFACE_NAME)
> {//add judgment
>                  this.resetRoutingTable(this._activeInfo);

 This modification will solve this issue but will cause another problem that wlan0 routing table is not removed
 Please use the patch in bug 888828 instead, thanks
Ok, we will use this patch, thanks. 
But I want to know when will cause this problem if use my patch?(wlan0 routing table is not removed).
You need to log in before you can comment on or make changes to this bug.