diff options
author | repo sync <isheriff@google.com> | 2011-09-29 12:40:02 -0700 |
---|---|---|
committer | repo sync <isheriff@google.com> | 2011-09-29 16:59:01 -0700 |
commit | 7960d9f888e31602e17b8856c77a3826bf8c841e (patch) | |
tree | 25449b839753fd26da7e6bcb4bfcb67fda6054e3 /wifi/java/android/net | |
parent | 3d0d7b41728277380d2e07f8de97c7bdf6840122 (diff) | |
download | frameworks_base-7960d9f888e31602e17b8856c77a3826bf8c841e.zip frameworks_base-7960d9f888e31602e17b8856c77a3826bf8c841e.tar.gz frameworks_base-7960d9f888e31602e17b8856c77a3826bf8c841e.tar.bz2 |
Fix IPv6 on wifi
Bug: 5388757
Change-Id: I3c8c776c26dad1daa9801d0455fde749c0206401
Diffstat (limited to 'wifi/java/android/net')
-rw-r--r-- | wifi/java/android/net/wifi/WifiStateMachine.java | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java index 41fc55d..d1522fb 100644 --- a/wifi/java/android/net/wifi/WifiStateMachine.java +++ b/wifi/java/android/net/wifi/WifiStateMachine.java @@ -1560,8 +1560,9 @@ public class WifiStateMachine extends StateMachine { try { mNwService.clearInterfaceAddresses(mInterfaceName); + mNwService.disableIpv6(mInterfaceName); } catch (Exception e) { - Log.e(TAG, "Failed to clear IP addresses on disconnect" + e); + Log.e(TAG, "Failed to clear addresses or disable ipv6" + e); } /* Reset data structures */ @@ -1841,6 +1842,21 @@ public class WifiStateMachine extends StateMachine { mWifiP2pManager = (WifiP2pManager) mContext.getSystemService(Context.WIFI_P2P_SERVICE); mWifiP2pChannel.connect(mContext, getHandler(), mWifiP2pManager.getMessenger()); + /* IPv6 is disabled at boot time and is controlled by framework + * to be enabled only as long as we are connected to an access point + * + * This fixes issues, a few being: + * - IPv6 addresses and routes stick around after disconnection + * - When connected, the kernel is unaware and can fail to start IPv6 negotiation + * - The kernel sometimes starts autoconfiguration when 802.1x is not complete + */ + try { + mNwService.disableIpv6(mInterfaceName); + } catch (RemoteException re) { + Log.e(TAG, "Failed to disable IPv6: " + re); + } catch (IllegalStateException e) { + Log.e(TAG, "Failed to disable IPv6: " + e); + } } } @@ -2734,7 +2750,15 @@ public class WifiStateMachine extends StateMachine { if (DBG) Log.d(TAG, getName() + "\n"); EventLog.writeEvent(EVENTLOG_WIFI_STATE_CHANGED, getName()); - if (!WifiConfigStore.isUsingStaticIp(mLastNetworkId)) { + try { + mNwService.enableIpv6(mInterfaceName); + } catch (RemoteException re) { + Log.e(TAG, "Failed to enable IPv6: " + re); + } catch (IllegalStateException e) { + Log.e(TAG, "Failed to enable IPv6: " + e); + } + + if (!WifiConfigStore.isUsingStaticIp(mLastNetworkId)) { //start DHCP mDhcpStateMachine = DhcpStateMachine.makeDhcpStateMachine( mContext, WifiStateMachine.this, mInterfaceName); @@ -2758,7 +2782,7 @@ public class WifiStateMachine extends StateMachine { sendMessage(CMD_STATIC_IP_FAILURE); } } - } + } @Override public boolean processMessage(Message message) { if (DBG) Log.d(TAG, getName() + message.toString() + "\n"); |