Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.server.connectivity; |
| 18 | |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 19 | import android.net.InterfaceConfiguration; |
Lorenzo Colitti | 853d741 | 2016-03-03 17:17:29 +0900 | [diff] [blame] | 20 | import android.net.ConnectivityManager; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 21 | import android.net.LinkAddress; |
| 22 | import android.net.LinkProperties; |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 23 | import android.net.NetworkAgent; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 24 | import android.net.RouteInfo; |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 25 | import android.os.Handler; |
| 26 | import android.os.Message; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 27 | import android.os.INetworkManagementService; |
| 28 | import android.os.RemoteException; |
| 29 | import android.util.Slog; |
| 30 | |
Hugo Benichi | 771d5c2 | 2017-07-05 11:08:48 +0900 | [diff] [blame] | 31 | import com.android.server.net.BaseNetworkObserver; |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 32 | import com.android.internal.util.ArrayUtils; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 33 | |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 34 | import java.net.Inet4Address; |
| 35 | import java.util.Objects; |
| 36 | |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 37 | /** |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 38 | * Class to manage a 464xlat CLAT daemon. |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 39 | * |
| 40 | * @hide |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 41 | */ |
| 42 | public class Nat464Xlat extends BaseNetworkObserver { |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 43 | private static final String TAG = Nat464Xlat.class.getSimpleName(); |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 44 | |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 45 | // This must match the interface prefix in clatd.c. |
| 46 | private static final String CLAT_PREFIX = "v4-"; |
| 47 | |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 48 | // The network types we will start clatd on, |
| 49 | // allowing clat only on networks for which we can support IPv6-only. |
Lorenzo Colitti | 853d741 | 2016-03-03 17:17:29 +0900 | [diff] [blame] | 50 | private static final int[] NETWORK_TYPES = { |
| 51 | ConnectivityManager.TYPE_MOBILE, |
| 52 | ConnectivityManager.TYPE_WIFI, |
| 53 | ConnectivityManager.TYPE_ETHERNET, |
| 54 | }; |
| 55 | |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 56 | private final INetworkManagementService mNMService; |
| 57 | |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 58 | // ConnectivityService Handler for LinkProperties updates. |
| 59 | private final Handler mHandler; |
| 60 | |
Lorenzo Colitti | e21a26b | 2014-10-28 15:24:03 +0900 | [diff] [blame] | 61 | // The network we're running on, and its type. |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 62 | private final NetworkAgentInfo mNetwork; |
| 63 | |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 64 | private enum State { |
| 65 | IDLE, // start() not called. Base iface and stacked iface names are null. |
| 66 | STARTING, // start() called. Base iface and stacked iface names are known. |
| 67 | RUNNING; // start() called, and the stacked iface is known to be up. |
| 68 | } |
| 69 | |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 70 | // Once mIface is non-null and isStarted() is true, methods called by ConnectivityService on |
| 71 | // its handler thread must not modify any internal state variables; they are only updated by the |
| 72 | // interface observers, called on the notification threads. |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 73 | private String mBaseIface; |
| 74 | private String mIface; |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 75 | private volatile State mState = State.IDLE; |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 76 | |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 77 | public Nat464Xlat(INetworkManagementService nmService, Handler handler, NetworkAgentInfo nai) { |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 78 | mNMService = nmService; |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 79 | mHandler = handler; |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 80 | mNetwork = nai; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | /** |
Paul Jensen | 3b75982 | 2014-05-13 11:44:01 -0400 | [diff] [blame] | 84 | * Determines whether a network requires clat. |
| 85 | * @param network the NetworkAgentInfo corresponding to the network. |
| 86 | * @return true if the network requires clat, false otherwise. |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 87 | */ |
Lorenzo Colitti | 1df5fa5 | 2014-09-20 13:47:47 +0900 | [diff] [blame] | 88 | public static boolean requiresClat(NetworkAgentInfo nai) { |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 89 | // TODO: migrate to NetworkCapabilities.TRANSPORT_*. |
Lorenzo Colitti | 1df5fa5 | 2014-09-20 13:47:47 +0900 | [diff] [blame] | 90 | final int netType = nai.networkInfo.getType(); |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 91 | final boolean supported = ArrayUtils.contains(NETWORK_TYPES, nai.networkInfo.getType()); |
Lorenzo Colitti | 1df5fa5 | 2014-09-20 13:47:47 +0900 | [diff] [blame] | 92 | final boolean connected = nai.networkInfo.isConnected(); |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 93 | // We only run clat on networks that don't have a native IPv4 address. |
Lorenzo Colitti | 1df5fa5 | 2014-09-20 13:47:47 +0900 | [diff] [blame] | 94 | final boolean hasIPv4Address = |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 95 | (nai.linkProperties != null) && nai.linkProperties.hasIPv4Address(); |
| 96 | return supported && connected && !hasIPv4Address; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 97 | } |
| 98 | |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 99 | /** |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 100 | * @return true if clatd has been started and has not yet stopped. |
| 101 | * A true result corresponds to internal states STARTING and RUNNING. |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 102 | */ |
| 103 | public boolean isStarted() { |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 104 | return mState != State.IDLE; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * @return true if clatd has been started and the stacked interface is up. |
| 109 | */ |
| 110 | public boolean isRunning() { |
| 111 | return mState == State.RUNNING; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Sets internal state. |
| 116 | */ |
| 117 | private void enterStartingState(String baseIface) { |
| 118 | mIface = CLAT_PREFIX + baseIface; |
| 119 | mBaseIface = baseIface; |
| 120 | mState = State.STARTING; |
Lorenzo Colitti | d2ef1e5 | 2013-03-28 14:13:43 +0900 | [diff] [blame] | 121 | } |
| 122 | |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 123 | /** |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 124 | * Clears internal state. Must not be called by ConnectivityService. |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 125 | */ |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 126 | private void enterIdleState() { |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 127 | mIface = null; |
| 128 | mBaseIface = null; |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 129 | mState = State.IDLE; |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 130 | } |
| 131 | |
| 132 | /** |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 133 | * Starts the clat daemon. Called by ConnectivityService on the handler thread. |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 134 | */ |
| 135 | public void start() { |
| 136 | if (isStarted()) { |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 137 | Slog.e(TAG, "startClat: already started"); |
| 138 | return; |
| 139 | } |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 140 | |
| 141 | if (mNetwork.linkProperties == null) { |
| 142 | Slog.e(TAG, "startClat: Can't start clat with null LinkProperties"); |
| 143 | return; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 144 | } |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 145 | |
| 146 | try { |
| 147 | mNMService.registerObserver(this); |
| 148 | } catch(RemoteException e) { |
| 149 | Slog.e(TAG, "startClat: Can't register interface observer for clat on " + mNetwork); |
| 150 | return; |
| 151 | } |
| 152 | |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 153 | String baseIface = mNetwork.linkProperties.getInterfaceName(); |
| 154 | if (baseIface == null) { |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 155 | Slog.e(TAG, "startClat: Can't start clat on null interface"); |
| 156 | return; |
| 157 | } |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 158 | // TODO: should we only do this if mNMService.startClatd() succeeds? |
| 159 | enterStartingState(baseIface); |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 160 | |
| 161 | Slog.i(TAG, "Starting clatd on " + mBaseIface); |
| 162 | try { |
| 163 | mNMService.startClatd(mBaseIface); |
| 164 | } catch(RemoteException|IllegalStateException e) { |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 165 | Slog.e(TAG, "Error starting clatd on " + mBaseIface, e); |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 166 | } |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 167 | } |
| 168 | |
| 169 | /** |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 170 | * Stops the clat daemon. Called by ConnectivityService on the handler thread. |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 171 | */ |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 172 | public void stop() { |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 173 | if (!isStarted()) { |
| 174 | Slog.e(TAG, "stopClat: already stopped or not started"); |
| 175 | return; |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 176 | } |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 177 | |
| 178 | Slog.i(TAG, "Stopping clatd on " + mBaseIface); |
| 179 | try { |
| 180 | mNMService.stopClatd(mBaseIface); |
| 181 | } catch(RemoteException|IllegalStateException e) { |
| 182 | Slog.e(TAG, "Error stopping clatd on " + mBaseIface, e); |
| 183 | } |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 184 | // When clatd stops and its interface is deleted, interfaceRemoved() will notify |
| 185 | // ConnectivityService and call enterIdleState(). |
| 186 | } |
| 187 | |
| 188 | private void updateConnectivityService(LinkProperties lp) { |
| 189 | Message msg = mHandler.obtainMessage(NetworkAgent.EVENT_NETWORK_PROPERTIES_CHANGED, lp); |
| 190 | msg.replyTo = mNetwork.messenger; |
| 191 | Slog.i(TAG, "sending message to ConnectivityService: " + msg); |
| 192 | msg.sendToTarget(); |
Paul Jensen | 3b75982 | 2014-05-13 11:44:01 -0400 | [diff] [blame] | 193 | } |
| 194 | |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 195 | /** |
| 196 | * Copies the stacked clat link in oldLp, if any, to the LinkProperties in mNetwork. |
| 197 | * This is necessary because the LinkProperties in mNetwork come from the transport layer, which |
| 198 | * has no idea that 464xlat is running on top of it. |
| 199 | */ |
| 200 | public void fixupLinkProperties(LinkProperties oldLp) { |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 201 | if (!isRunning()) { |
| 202 | return; |
| 203 | } |
| 204 | LinkProperties lp = mNetwork.linkProperties; |
| 205 | if (lp == null || lp.getAllInterfaceNames().contains(mIface)) { |
| 206 | return; |
| 207 | } |
| 208 | |
| 209 | Slog.d(TAG, "clatd running, updating NAI for " + mIface); |
| 210 | for (LinkProperties stacked: oldLp.getStackedLinks()) { |
| 211 | if (Objects.equals(mIface, stacked.getInterfaceName())) { |
| 212 | lp.addStackedLink(stacked); |
| 213 | return; |
Lorenzo Colitti | 1df5fa5 | 2014-09-20 13:47:47 +0900 | [diff] [blame] | 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 218 | private LinkProperties makeLinkProperties(LinkAddress clatAddress) { |
| 219 | LinkProperties stacked = new LinkProperties(); |
| 220 | stacked.setInterfaceName(mIface); |
| 221 | |
| 222 | // Although the clat interface is a point-to-point tunnel, we don't |
| 223 | // point the route directly at the interface because some apps don't |
| 224 | // understand routes without gateways (see, e.g., http://b/9597256 |
| 225 | // http://b/9597516). Instead, set the next hop of the route to the |
| 226 | // clat IPv4 address itself (for those apps, it doesn't matter what |
| 227 | // the IP of the gateway is, only that there is one). |
| 228 | RouteInfo ipv4Default = new RouteInfo( |
| 229 | new LinkAddress(Inet4Address.ANY, 0), |
| 230 | clatAddress.getAddress(), mIface); |
| 231 | stacked.addRoute(ipv4Default); |
| 232 | stacked.addLinkAddress(clatAddress); |
| 233 | return stacked; |
| 234 | } |
| 235 | |
Lorenzo Colitti | e21a26b | 2014-10-28 15:24:03 +0900 | [diff] [blame] | 236 | private LinkAddress getLinkAddress(String iface) { |
| 237 | try { |
| 238 | InterfaceConfiguration config = mNMService.getInterfaceConfig(iface); |
| 239 | return config.getLinkAddress(); |
| 240 | } catch(RemoteException|IllegalStateException e) { |
| 241 | Slog.e(TAG, "Error getting link properties: " + e); |
| 242 | return null; |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | private void maybeSetIpv6NdOffload(String iface, boolean on) { |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 247 | // TODO: migrate to NetworkCapabilities.TRANSPORT_*. |
Lorenzo Colitti | 853d741 | 2016-03-03 17:17:29 +0900 | [diff] [blame] | 248 | if (mNetwork.networkInfo.getType() != ConnectivityManager.TYPE_WIFI) { |
Lorenzo Colitti | e21a26b | 2014-10-28 15:24:03 +0900 | [diff] [blame] | 249 | return; |
| 250 | } |
| 251 | try { |
| 252 | Slog.d(TAG, (on ? "En" : "Dis") + "abling ND offload on " + iface); |
| 253 | mNMService.setInterfaceIpv6NdOffload(iface, on); |
| 254 | } catch(RemoteException|IllegalStateException e) { |
| 255 | Slog.w(TAG, "Changing IPv6 ND offload on " + iface + "failed: " + e); |
| 256 | } |
| 257 | } |
| 258 | |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 259 | /** |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 260 | * Adds stacked link on base link and transitions to Running state |
| 261 | * This is called by the InterfaceObserver on its own thread, so can race with stop(). |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 262 | */ |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 263 | @Override |
| 264 | public void interfaceLinkStateChanged(String iface, boolean up) { |
| 265 | if (!isStarted() || !up || !Objects.equals(mIface, iface)) { |
| 266 | return; |
| 267 | } |
| 268 | if (isRunning()) { |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 269 | return; |
| 270 | } |
| 271 | LinkAddress clatAddress = getLinkAddress(iface); |
| 272 | if (clatAddress == null) { |
| 273 | return; |
| 274 | } |
| 275 | mState = State.RUNNING; |
| 276 | Slog.i(TAG, String.format("interface %s is up, adding stacked link %s on top of %s", |
| 277 | mIface, mIface, mBaseIface)); |
| 278 | |
| 279 | maybeSetIpv6NdOffload(mBaseIface, false); |
| 280 | LinkProperties lp = new LinkProperties(mNetwork.linkProperties); |
| 281 | lp.addStackedLink(makeLinkProperties(clatAddress)); |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 282 | updateConnectivityService(lp); |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 283 | } |
| 284 | |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 285 | @Override |
| 286 | public void interfaceRemoved(String iface) { |
| 287 | if (!isStarted() || !Objects.equals(mIface, iface)) { |
| 288 | return; |
| 289 | } |
| 290 | if (!isRunning()) { |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 291 | return; |
| 292 | } |
| 293 | |
| 294 | Slog.i(TAG, "interface " + iface + " removed"); |
| 295 | // The interface going away likely means clatd has crashed. Ask netd to stop it, |
| 296 | // because otherwise when we try to start it again on the same base interface netd |
| 297 | // will complain that it's already started. |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 298 | // |
| 299 | // Note that this method can be called by the interface observer at the same time |
| 300 | // that ConnectivityService calls stop(). In this case, the second call to |
| 301 | // stopClatd() will just throw IllegalStateException, which we'll ignore. |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 302 | try { |
| 303 | mNMService.unregisterObserver(this); |
| 304 | mNMService.stopClatd(mBaseIface); |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 305 | } catch (RemoteException|IllegalStateException e) { |
| 306 | // Well, we tried. |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 307 | } |
| 308 | maybeSetIpv6NdOffload(mBaseIface, true); |
| 309 | LinkProperties lp = new LinkProperties(mNetwork.linkProperties); |
| 310 | lp.removeStackedLink(mIface); |
| 311 | enterIdleState(); |
Hugo Benichi | 50d46a4 | 2017-08-31 14:29:51 +0000 | [diff] [blame^] | 312 | updateConnectivityService(lp); |
Lorenzo Colitti | 13c9fde | 2013-03-15 04:22:37 +0900 | [diff] [blame] | 313 | } |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 314 | |
| 315 | @Override |
| 316 | public String toString() { |
Hugo Benichi | 4f6f139 | 2017-06-29 14:04:13 +0900 | [diff] [blame] | 317 | return "mBaseIface: " + mBaseIface + ", mIface: " + mIface + ", mState: " + mState; |
Hugo Benichi | b577d65 | 2017-06-27 15:13:20 +0900 | [diff] [blame] | 318 | } |
Lorenzo Colitti | 9543946 | 2014-10-09 13:44:48 +0900 | [diff] [blame] | 319 | } |