xds: avoid unnecessary dns lookup (#11932)

This commit is contained in:
MV Shiva 2025-03-06 10:34:53 +00:00 committed by GitHub
parent 12197065fe
commit 602aece081
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 82 additions and 49 deletions

View File

@ -27,7 +27,6 @@ import io.grpc.Internal;
import io.grpc.xds.client.EnvoyProtoData; import io.grpc.xds.client.EnvoyProtoData;
import io.grpc.xds.internal.security.SslContextProviderSupplier; import io.grpc.xds.internal.security.SslContextProviderSupplier;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Objects; import java.util.Objects;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -150,9 +149,9 @@ public final class EnvoyServerProtoData {
abstract int prefixLen(); abstract int prefixLen();
static CidrRange create(String addressPrefix, int prefixLen) throws UnknownHostException { static CidrRange create(InetAddress addressPrefix, int prefixLen) {
return new AutoValue_EnvoyServerProtoData_CidrRange( return new AutoValue_EnvoyServerProtoData_CidrRange(
InetAddress.getByName(addressPrefix), prefixLen); addressPrefix, prefixLen);
} }
} }

View File

@ -25,6 +25,7 @@ import com.github.udpa.udpa.type.v1.TypedStruct;
import com.google.auto.value.AutoValue; import com.google.auto.value.AutoValue;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.net.InetAddresses;
import com.google.protobuf.Any; import com.google.protobuf.Any;
import com.google.protobuf.InvalidProtocolBufferException; import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message; import com.google.protobuf.Message;
@ -43,7 +44,6 @@ import io.grpc.xds.EnvoyServerProtoData.FilterChainMatch;
import io.grpc.xds.Filter.FilterConfig; import io.grpc.xds.Filter.FilterConfig;
import io.grpc.xds.XdsListenerResource.LdsUpdate; import io.grpc.xds.XdsListenerResource.LdsUpdate;
import io.grpc.xds.client.XdsResourceType; import io.grpc.xds.client.XdsResourceType;
import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
@ -446,16 +446,18 @@ class XdsListenerResource extends XdsResourceType<LdsUpdate> {
try { try {
for (io.envoyproxy.envoy.config.core.v3.CidrRange range : proto.getPrefixRangesList()) { for (io.envoyproxy.envoy.config.core.v3.CidrRange range : proto.getPrefixRangesList()) {
prefixRanges.add( prefixRanges.add(
CidrRange.create(range.getAddressPrefix(), range.getPrefixLen().getValue())); CidrRange.create(InetAddresses.forString(range.getAddressPrefix()),
range.getPrefixLen().getValue()));
} }
for (io.envoyproxy.envoy.config.core.v3.CidrRange range for (io.envoyproxy.envoy.config.core.v3.CidrRange range
: proto.getSourcePrefixRangesList()) { : proto.getSourcePrefixRangesList()) {
sourcePrefixRanges.add( sourcePrefixRanges.add(CidrRange.create(
CidrRange.create(range.getAddressPrefix(), range.getPrefixLen().getValue())); InetAddresses.forString(range.getAddressPrefix()), range.getPrefixLen().getValue()));
} }
} catch (UnknownHostException e) { } catch (IllegalArgumentException ex) {
throw new ResourceInvalidException("Failed to create CidrRange", e); throw new ResourceInvalidException("Failed to create CidrRange", ex);
} }
ConnectionSourceType sourceType; ConnectionSourceType sourceType;
switch (proto.getSourceType()) { switch (proto.getSourceType()) {
case ANY: case ANY:

View File

@ -25,6 +25,7 @@ import static org.mockito.Mockito.when;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.net.InetAddresses;
import com.google.common.util.concurrent.SettableFuture; import com.google.common.util.concurrent.SettableFuture;
import io.grpc.ServerInterceptor; import io.grpc.ServerInterceptor;
import io.grpc.internal.TestUtils.NoopChannelLogger; import io.grpc.internal.TestUtils.NoopChannelLogger;
@ -58,7 +59,6 @@ import io.netty.handler.codec.http2.Http2ConnectionEncoder;
import io.netty.handler.codec.http2.Http2Settings; import io.netty.handler.codec.http2.Http2Settings;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.net.UnknownHostException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
@ -318,7 +318,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatchWithMatch = EnvoyServerProtoData.FilterChainMatch filterChainMatchWithMatch =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.1.2.0", 24)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.0"), 24)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -360,7 +361,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatchWithMismatch = EnvoyServerProtoData.FilterChainMatch filterChainMatchWithMismatch =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.2.2.0", 24)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.2.2.0"), 24)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -403,7 +405,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatch0Length = EnvoyServerProtoData.FilterChainMatch filterChainMatch0Length =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.2.2.0", 0)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.2.2.0"), 0)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -444,7 +447,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatchLessSpecific = EnvoyServerProtoData.FilterChainMatch filterChainMatchLessSpecific =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.1.2.0", 24)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.0"), 24)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -461,7 +465,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatchMoreSpecific = EnvoyServerProtoData.FilterChainMatch filterChainMatchMoreSpecific =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.1.2.2", 31)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.2"), 31)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -519,7 +524,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatchMoreSpecific = EnvoyServerProtoData.FilterChainMatch filterChainMatchMoreSpecific =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("8.0.0.0", 5)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("8.0.0.0"), 5)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -559,7 +565,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatchLessSpecific = EnvoyServerProtoData.FilterChainMatch filterChainMatchLessSpecific =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("FE80:0:0:0:0:0:0:0", 60)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("FE80:0:0:0:0:0:0:0"), 60)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -577,7 +584,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("FE80:0000:0000:0000:0202:0:0:0", 80)), EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("FE80:0000:0000:0000:0202:0:0:0"), 80)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -620,8 +628,10 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("10.1.2.0", 24), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create(LOCAL_IP, 32)), InetAddresses.forString("10.1.2.0"), 24),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString(LOCAL_IP), 32)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -638,7 +648,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatchLessSpecific = EnvoyServerProtoData.FilterChainMatch filterChainMatchLessSpecific =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.1.2.2", 31)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.2"), 31)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -763,8 +774,10 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("10.4.2.0", 24), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create(REMOTE_IP, 32)), InetAddresses.forString("10.4.2.0"), 24),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString(REMOTE_IP), 32)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
@ -781,7 +794,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
0, 0,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.4.2.2", 31)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.4.2.2"), 31)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
@ -811,8 +825,7 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
} }
@Test @Test
public void sourcePrefixRange_2Matchers_expectException() public void sourcePrefixRange_2Matchers_expectException() {
throws UnknownHostException {
ChannelHandler next = new ChannelInboundHandlerAdapter() { ChannelHandler next = new ChannelInboundHandlerAdapter() {
@Override @Override
public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { public void userEventTriggered(ChannelHandlerContext ctx, Object evt) {
@ -831,8 +844,10 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("10.4.2.0", 24), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("192.168.10.2", 32)), InetAddresses.forString("10.4.2.0"), 24),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("192.168.10.2"), 32)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
@ -848,7 +863,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
0, 0,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.4.2.0", 24)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.4.2.0"), 24)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
@ -890,8 +906,10 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("10.4.2.0", 24), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("10.4.2.2", 31)), InetAddresses.forString("10.4.2.0"), 24),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.4.2.2"), 31)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
@ -908,7 +926,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
0, 0,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.4.2.2", 31)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.4.2.2"), 31)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(7000, 15000), ImmutableList.of(7000, 15000),
ImmutableList.of(), ImmutableList.of(),
@ -966,7 +985,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
PORT, PORT,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(EnvoyServerProtoData.CidrRange.create(REMOTE_IP, 32)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString(REMOTE_IP), 32)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
@ -981,9 +1001,11 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatch2 = EnvoyServerProtoData.FilterChainMatch filterChainMatch2 =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.1.2.0", 30)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.0"), 30)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.4.0.0", 16)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.4.0.0"), 16)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
@ -997,8 +1019,10 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("192.168.2.0", 24), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("10.1.2.0", 30)), InetAddresses.forString("192.168.2.0"), 24),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.0"), 30)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.SAME_IP_OR_LOOPBACK, EnvoyServerProtoData.ConnectionSourceType.SAME_IP_OR_LOOPBACK,
@ -1015,10 +1039,13 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("10.1.0.0", 16), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("10.1.2.0", 30)), InetAddresses.forString("10.1.0.0"), 16),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.0"), 30)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.4.2.0", 24)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.4.2.0"), 24)),
EnvoyServerProtoData.ConnectionSourceType.EXTERNAL, EnvoyServerProtoData.ConnectionSourceType.EXTERNAL,
ImmutableList.of(16000, 9000), ImmutableList.of(16000, 9000),
ImmutableList.of(), ImmutableList.of(),
@ -1034,12 +1061,16 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("10.1.0.0", 16), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("10.1.2.0", 30)), InetAddresses.forString("10.1.0.0"), 16),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.0"), 30)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of( ImmutableList.of(
EnvoyServerProtoData.CidrRange.create("10.4.2.0", 24), EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("192.168.2.0", 24)), InetAddresses.forString("10.4.2.0"), 24),
EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("192.168.2.0"), 24)),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
ImmutableList.of(15000, 8000), ImmutableList.of(15000, 8000),
ImmutableList.of(), ImmutableList.of(),
@ -1053,7 +1084,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatch6 = EnvoyServerProtoData.FilterChainMatch filterChainMatch6 =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0, 0,
ImmutableList.of(EnvoyServerProtoData.CidrRange.create("10.1.2.0", 29)), ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
InetAddresses.forString("10.1.2.0"), 29)),
ImmutableList.of(), ImmutableList.of(),
ImmutableList.of(), ImmutableList.of(),
EnvoyServerProtoData.ConnectionSourceType.ANY, EnvoyServerProtoData.ConnectionSourceType.ANY,
@ -1105,8 +1137,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatch1 = EnvoyServerProtoData.FilterChainMatch filterChainMatch1 =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0 /* destinationPort */, 0 /* destinationPort */,
ImmutableList.of( ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("10.1.0.0", 16)) /* prefixRange */, InetAddresses.forString("10.1.0.0"), 16)) /* prefixRange */,
ImmutableList.of("managed-mtls", "h2") /* applicationProtocol */, ImmutableList.of("managed-mtls", "h2") /* applicationProtocol */,
ImmutableList.of() /* sourcePrefixRanges */, ImmutableList.of() /* sourcePrefixRanges */,
EnvoyServerProtoData.ConnectionSourceType.ANY /* sourceType */, EnvoyServerProtoData.ConnectionSourceType.ANY /* sourceType */,
@ -1117,8 +1149,8 @@ public class FilterChainMatchingProtocolNegotiatorsTest {
EnvoyServerProtoData.FilterChainMatch filterChainMatch2 = EnvoyServerProtoData.FilterChainMatch filterChainMatch2 =
EnvoyServerProtoData.FilterChainMatch.create( EnvoyServerProtoData.FilterChainMatch.create(
0 /* destinationPort */, 0 /* destinationPort */,
ImmutableList.of( ImmutableList.of(EnvoyServerProtoData.CidrRange.create(
EnvoyServerProtoData.CidrRange.create("10.0.0.0", 8)) /* prefixRange */, InetAddresses.forString("10.0.0.0"), 8)) /* prefixRange */,
ImmutableList.of() /* applicationProtocol */, ImmutableList.of() /* applicationProtocol */,
ImmutableList.of() /* sourcePrefixRanges */, ImmutableList.of() /* sourcePrefixRanges */,
EnvoyServerProtoData.ConnectionSourceType.ANY /* sourceType */, EnvoyServerProtoData.ConnectionSourceType.ANY /* sourceType */,