Merge "Revert "Set accept_ra_rt_info_max_plen to 64 before enabling IPv6 interfaces""
am: 63d26caa38
Change-Id: I367506eee558dbd7abeeabf09716f7024c2e43d8
This commit is contained in:
@ -16,8 +16,6 @@
|
|||||||
|
|
||||||
package android.net.ip;
|
package android.net.ip;
|
||||||
|
|
||||||
import static android.net.util.NetworkConstants.RFC7421_PREFIX_LENGTH;
|
|
||||||
|
|
||||||
import com.android.internal.util.MessageUtils;
|
import com.android.internal.util.MessageUtils;
|
||||||
import com.android.internal.util.WakeupMessage;
|
import com.android.internal.util.WakeupMessage;
|
||||||
|
|
||||||
@ -44,7 +42,6 @@ import android.os.RemoteException;
|
|||||||
import android.os.ServiceManager;
|
import android.os.ServiceManager;
|
||||||
import android.os.ServiceSpecificException;
|
import android.os.ServiceSpecificException;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
import android.system.OsConstants;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.LocalLog;
|
import android.util.LocalLog;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -1031,36 +1028,15 @@ public class IpManager extends StateMachine {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableInterfaceIPv6PrivacyExtensions() {
|
private boolean startIPv6() {
|
||||||
|
// Set privacy extensions.
|
||||||
final String PREFER_TEMPADDRS = "2";
|
final String PREFER_TEMPADDRS = "2";
|
||||||
NetdService.run((INetd netd) -> {
|
|
||||||
netd.setProcSysNet(
|
|
||||||
INetd.IPV6, INetd.CONF, mInterfaceName, "use_tempaddr", PREFER_TEMPADDRS);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setInterfaceIPv6RaRtInfoMaxPlen(int plen) {
|
|
||||||
// Setting RIO max plen is best effort. Catch and ignore most exceptions.
|
|
||||||
try {
|
try {
|
||||||
NetdService.run((INetd netd) -> {
|
NetdService.run((INetd netd) -> {
|
||||||
netd.setProcSysNet(
|
netd.setProcSysNet(
|
||||||
INetd.IPV6, INetd.CONF, mInterfaceName, "accept_ra_rt_info_max_plen",
|
INetd.IPV6, INetd.CONF, mInterfaceName, "use_tempaddr",
|
||||||
Integer.toString(plen));
|
PREFER_TEMPADDRS);
|
||||||
});
|
});
|
||||||
} catch (ServiceSpecificException e) {
|
|
||||||
// Old kernel versions without support for RIOs do not export accept_ra_rt_info_max_plen
|
|
||||||
// in the /proc filesystem. If the kernel supports RIOs we should never see any other
|
|
||||||
// type of error.
|
|
||||||
if (e.errorCode != OsConstants.ENOENT) {
|
|
||||||
logError("unexpected error setting accept_ra_rt_info_max_plen %s", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean startIPv6() {
|
|
||||||
try {
|
|
||||||
enableInterfaceIPv6PrivacyExtensions();
|
|
||||||
setInterfaceIPv6RaRtInfoMaxPlen(RFC7421_PREFIX_LENGTH);
|
|
||||||
mNwService.enableIpv6(mInterfaceName);
|
mNwService.enableIpv6(mInterfaceName);
|
||||||
} catch (IllegalStateException|RemoteException|ServiceSpecificException e) {
|
} catch (IllegalStateException|RemoteException|ServiceSpecificException e) {
|
||||||
logError("Unable to change interface settings: %s", e);
|
logError("Unable to change interface settings: %s", e);
|
||||||
|
Reference in New Issue
Block a user