Cleanup the IPCLIENT_ACCEPT_IPV6_LINK_LOCAL_DNS_VERSION flag.
This fix (accept the IPv6 link-local DNS server) has been enabled by
default and rolled out via M-2023-08 train, cleanup the constant flag
string and associated dead code in the IpClientLinkObserver and tests.
Bug: 300003598
Test: atest NetworkStackRootTests
Change-Id: I63e295a3b3a60189039b62797c9b3058f6ca520f
diff --git a/src/android/net/ip/IpClientLinkObserver.java b/src/android/net/ip/IpClientLinkObserver.java
index 9185443..fbec082 100644
--- a/src/android/net/ip/IpClientLinkObserver.java
+++ b/src/android/net/ip/IpClientLinkObserver.java
@@ -28,7 +28,6 @@
import static com.android.net.module.util.netlink.NetlinkConstants.RTPROT_KERNEL;
import static com.android.net.module.util.netlink.NetlinkConstants.RTPROT_RA;
import static com.android.net.module.util.netlink.NetlinkConstants.RT_SCOPE_UNIVERSE;
-import static com.android.networkstack.util.NetworkStackUtils.IPCLIENT_ACCEPT_IPV6_LINK_LOCAL_DNS_VERSION;
import android.app.AlarmManager;
import android.content.Context;
@@ -216,11 +215,6 @@
mHandler.post(mNetlinkMonitor::stop);
}
- private boolean isIpv6LinkLocalDnsAccepted() {
- return mDependencies.isFeatureNotChickenedOut(mContext,
- IPCLIENT_ACCEPT_IPV6_LINK_LOCAL_DNS_VERSION);
- }
-
private void maybeLog(String operation, String iface, LinkAddress address) {
if (DBG) {
Log.d(mTag, operation + ": " + address + " on " + iface
@@ -493,9 +487,7 @@
private void processRdnssOption(StructNdOptRdnss opt) {
final String[] addresses = new String[opt.servers.length];
for (int i = 0; i < opt.servers.length; i++) {
- final Inet6Address addr = isIpv6LinkLocalDnsAccepted()
- ? InetAddressUtils.withScopeId(opt.servers[i], mIfindex)
- : opt.servers[i];
+ final Inet6Address addr = InetAddressUtils.withScopeId(opt.servers[i], mIfindex);
addresses[i] = addr.getHostAddress();
}
updateInterfaceDnsServerInfo(opt.header.lifetime, addresses);
diff --git a/src/com/android/networkstack/util/NetworkStackUtils.java b/src/com/android/networkstack/util/NetworkStackUtils.java
index 6c5f731..4e3a8fd 100755
--- a/src/com/android/networkstack/util/NetworkStackUtils.java
+++ b/src/com/android/networkstack/util/NetworkStackUtils.java
@@ -193,14 +193,6 @@
"ipclient_garp_na_roaming_version";
/**
- * Experiment flag to check if an on-link IPv6 link local DNS is acceptable. The default flag
- * value is true, just add this flag for A/B testing to see if this fix works as expected via
- * experiment rollout.
- */
- public static final String IPCLIENT_ACCEPT_IPV6_LINK_LOCAL_DNS_VERSION =
- "ipclient_accept_ipv6_link_local_dns_version";
-
- /**
* Experiment flag to enable "mcast_resolicit" neighbor parameter in IpReachabilityMonitor,
* set it to 3 by default.
*/
diff --git a/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java b/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
index ee85ce7..cdd9466 100644
--- a/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
+++ b/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
@@ -2219,14 +2219,11 @@
reset(mCb);
}
- private void runRaRdnssIpv6LinkLocalDnsTest(boolean isIpv6LinkLocalDnsAccepted)
- throws Exception {
+ private void runRaRdnssIpv6LinkLocalDnsTest() throws Exception {
ProvisioningConfiguration config = new ProvisioningConfiguration.Builder()
.withoutIpReachabilityMonitor()
.withoutIPv4()
.build();
- setFeatureEnabled(NetworkStackUtils.IPCLIENT_ACCEPT_IPV6_LINK_LOCAL_DNS_VERSION,
- isIpv6LinkLocalDnsAccepted /* default value */);
startIpClientProvisioning(config);
final ByteBuffer pio = buildPioOption(600, 300, "2001:db8:1::/64");
@@ -2242,7 +2239,7 @@
@Test
public void testRaRdnss_Ipv6LinkLocalDns() throws Exception {
- runRaRdnssIpv6LinkLocalDnsTest(true /* isIpv6LinkLocalDnsAccepted */);
+ runRaRdnssIpv6LinkLocalDnsTest();
final ArgumentCaptor<LinkProperties> captor = ArgumentCaptor.forClass(LinkProperties.class);
verify(mCb, timeout(TEST_TIMEOUT_MS)).onProvisioningSuccess(captor.capture());
final LinkProperties lp = captor.getValue();
@@ -2252,17 +2249,6 @@
assertTrue(lp.isIpv6Provisioned());
}
- @Test
- public void testRaRdnss_disableIpv6LinkLocalDns() throws Exception {
- runRaRdnssIpv6LinkLocalDnsTest(false /* isIpv6LinkLocalDnsAccepted */);
- verify(mCb, timeout(TEST_TIMEOUT_MS)).onLinkPropertiesChange(argThat(lp -> {
- return lp.hasGlobalIpv6Address()
- && lp.hasIpv6DefaultRoute()
- && !lp.hasIpv6DnsServer();
- }));
- verify(mCb, never()).onProvisioningSuccess(any());
- }
-
private void expectNat64PrefixUpdate(InOrder inOrder, IpPrefix expected) throws Exception {
inOrder.verify(mCb, timeout(TEST_TIMEOUT_MS)).onLinkPropertiesChange(
argThat(lp -> Objects.equals(expected, lp.getNat64Prefix())));