@@ -807,6 +807,51 @@ QuicTestConnectUnreachable(
807
807
}
808
808
}
809
809
810
+ void
811
+ QuicTestConnectInvalidAddress (
812
+ )
813
+ {
814
+ MsQuicRegistration Registration;
815
+ TEST_TRUE (Registration.IsValid ());
816
+
817
+ MsQuicAlpn Alpn (" MsQuicTest" );
818
+
819
+ MsQuicSettings Settings;
820
+ Settings.SetIdleTimeoutMs (3000 );
821
+
822
+ MsQuicCredentialConfig ClientCredConfig;
823
+ MsQuicConfiguration ClientConfiguration (Registration, Alpn, Settings, ClientCredConfig);
824
+ TEST_TRUE (ClientConfiguration.IsValid ());
825
+
826
+ {
827
+ TestConnection Client (Registration);
828
+ TEST_TRUE (Client.IsValid ());
829
+
830
+ QuicAddr LocalAddr{QUIC_ADDRESS_FAMILY_INET, true };
831
+ LocalAddr.SetPort (TestUdpPortBase - 2 );
832
+
833
+ QuicAddr RemoteAddr{QUIC_ADDRESS_FAMILY_INET6, true };
834
+ RemoteAddr.SetPort (TestUdpPortBase - 1 );
835
+
836
+ TEST_QUIC_SUCCEEDED (Client.SetLocalAddr (LocalAddr));
837
+ TEST_QUIC_SUCCEEDED (Client.SetRemoteAddr (RemoteAddr));
838
+
839
+ Client.SetExpectedTransportCloseStatus (QUIC_STATUS_INVALID_ADDRESS);
840
+ TEST_QUIC_SUCCEEDED (
841
+ Client.Start (
842
+ ClientConfiguration,
843
+ QUIC_ADDRESS_FAMILY_INET6,
844
+ QUIC_LOCALHOST_FOR_AF (QUIC_ADDRESS_FAMILY_INET6),
845
+ TestUdpPortBase - 1 ));
846
+ if (!Client.WaitForConnectionComplete ()) {
847
+ return ;
848
+ }
849
+
850
+ TEST_FALSE (Client.GetIsConnected ());
851
+ TEST_TRUE (Client.GetTransportClosed ());
852
+ }
853
+ }
854
+
810
855
void
811
856
QuicTestVersionNegotiation (
812
857
_In_ int Family
0 commit comments