diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-03-16 12:06:41 +0000 |
---|---|---|
committer | Xiao Ma <xiaom@google.com> | 2020-03-17 08:04:12 +0000 |
commit | eada781b259a22fe53c7ea4e9354bf174bece974 (patch) | |
tree | 13800c13074bd68f3cdeda41c863da86a327bdd8 /src/android/net/ip/IpClient.java | |
parent | 97397fadd3e064882600f7dff34aa00de3b4bd79 (diff) |
Provide RRO to configure neighbor unreachable probes parameters.
Bug: 130871097
Test: atest FrameworksNetTests NetworkStackTests
Merged-In: Idc2c4303640d4fd3fc29dd0957771088820030ff
(cherry picked from commit f540206076ca0e55d685ef81e3e04da3e9a654cf)
Change-Id: Icd69008635461aa24d976f9b9d2d0ef1d60e23d5
Diffstat (limited to 'src/android/net/ip/IpClient.java')
-rw-r--r-- | src/android/net/ip/IpClient.java | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/src/android/net/ip/IpClient.java b/src/android/net/ip/IpClient.java index 163005a..bfeac8b 100644 --- a/src/android/net/ip/IpClient.java +++ b/src/android/net/ip/IpClient.java @@ -1364,19 +1364,6 @@ public class IpClient extends StateMachine { private boolean startIpReachabilityMonitor() { try { - // TODO: Fetch these parameters from settings, and install a - // settings observer to watch for update and re-program these - // parameters (Q: is this level of dynamic updatability really - // necessary or does reading from settings at startup suffice?). - final int numSolicits = 5; - final int interSolicitIntervalMs = 750; - setNeighborParameters(mNetd, mInterfaceName, numSolicits, interSolicitIntervalMs); - } catch (Exception e) { - mLog.e("Failed to adjust neighbor parameters", e); - // Carry on using the system defaults (currently: 3, 1000); - } - - try { mIpReachabilityMonitor = new IpReachabilityMonitor( mContext, mInterfaceParams, @@ -1388,7 +1375,8 @@ public class IpClient extends StateMachine { mCallback.onReachabilityLost(logMsg); } }, - mConfiguration.mUsingMultinetworkPolicyTracker); + mConfiguration.mUsingMultinetworkPolicyTracker, + mNetd); } catch (IllegalArgumentException iae) { // Failed to start IpReachabilityMonitor. Log it and call // onProvisioningFailure() immediately. @@ -1986,22 +1974,6 @@ public class IpClient extends StateMachine { } } - private static void setNeighborParameters( - INetd netd, String ifName, int numSolicits, int interSolicitIntervalMs) - throws RemoteException, IllegalArgumentException { - Preconditions.checkNotNull(netd); - Preconditions.checkArgument(!TextUtils.isEmpty(ifName)); - Preconditions.checkArgument(numSolicits > 0); - Preconditions.checkArgument(interSolicitIntervalMs > 0); - - for (int family : new Integer[]{INetd.IPV4, INetd.IPV6}) { - netd.setProcSysNet(family, INetd.NEIGH, ifName, "retrans_time_ms", - Integer.toString(interSolicitIntervalMs)); - netd.setProcSysNet(family, INetd.NEIGH, ifName, "ucast_solicit", - Integer.toString(numSolicits)); - } - } - // TODO: extract out into CollectionUtils. static <T> boolean any(Iterable<T> coll, Predicate<T> fn) { for (T t : coll) { |