@@ -1189,7 +1189,7 @@ void CSteamNetworkingICESession::InvalidateInterfaceList()
11891189
11901190void CSteamNetworkingICESession::SetSelectedCandidatePair ( ICECandidatePair *pPair )
11911191{
1192- SpewMsg ( " \n\n Selected candidate %s -> %s.\n\n " , SteamNetworkingIPAddrRender ( pPair->m_localCandidate .m_base ).c_str (), SteamNetworkingIPAddrRender ( pPair->m_remoteCandidate .m_addr ).c_str () );
1192+ SpewMsg ( " \n\n Selected candidate %s -> %s.\n\n " , SteamNetworkingIPAddrRender ( pPair->m_localCandidate .m_pInterface -> m_pSocket -> m_boundAddr ).c_str (), SteamNetworkingIPAddrRender ( pPair->m_remoteCandidate .m_addr ).c_str () );
11931193 m_pSelectedCandidatePair = pPair;
11941194 m_pSelectedSocket = pPair->m_localCandidate .m_pInterface ->m_pSocket ;
11951195 if ( m_pCallbacks )
@@ -1421,7 +1421,7 @@ void CSteamNetworkingICESession::OnPacketReceived( const RecvPktInfo_t &info )
14211421 for ( ICECandidatePair *pPair : m_vecCandidatePairs )
14221422 {
14231423 if ( pPair->m_remoteCandidate .m_addr == fromAddr
1424- && pPair->m_localCandidate .m_base == localAddr )
1424+ && pPair->m_localCandidate .m_pInterface -> m_pSocket == info. m_pSock )
14251425 {
14261426 pThisPair = pPair;
14271427 break ;
@@ -1439,7 +1439,7 @@ void CSteamNetworkingICESession::OnPacketReceived( const RecvPktInfo_t &info )
14391439 ICELocalCandidate *pLocalCandidate = nullptr ;
14401440 for ( ICELocalCandidate &c : m_vecCandidates )
14411441 {
1442- if ( c.m_base == localAddr )
1442+ if ( c.m_pInterface -> m_pSocket == info. m_pSock )
14431443 {
14441444 pLocalCandidate = &c;
14451445 break ;
@@ -1573,7 +1573,7 @@ void CSteamNetworkingICESession::Think_DiscoverServerReflexiveCandidates()
15731573 {
15741574 for ( const ICELocalCandidate& c2 : m_vecCandidates )
15751575 {
1576- if ( c2.m_type == ICECandidateKind::ServerReflexive && c2.m_base == c.m_base )
1576+ if ( c2.m_type == ICECandidateKind::ServerReflexive && c2.m_pInterface == c.m_pInterface )
15771577 {
15781578 bFound = true ;
15791579 break ;
@@ -1593,7 +1593,7 @@ void CSteamNetworkingICESession::Think_DiscoverServerReflexiveCandidates()
15931593 const SteamNetworkingIPAddr *pSTUNServer = nullptr ;
15941594 for ( const SteamNetworkingIPAddr &srv : m_vecSTUNServers )
15951595 {
1596- if ( srv.IsIPv4 () == c.m_base .IsIPv4 () )
1596+ if ( srv.IsIPv4 () == c.m_pInterface -> m_pSocket -> m_boundAddr .IsIPv4 () )
15971597 {
15981598 pSTUNServer = &srv;
15991599 break ;
@@ -1623,7 +1623,7 @@ void CSteamNetworkingICESession::UpdateHostCandidates()
16231623 ICELocalCandidate *pHostCandidate = nullptr ;
16241624 for ( const ICELocalCandidate& prevCandidate : vecPreviousCandidates )
16251625 {
1626- if ( prevCandidate.m_base == hostCandidateAddr )
1626+ if ( prevCandidate.m_pInterface == pIntf. get () )
16271627 {
16281628 ICELocalCandidate *pAdded = push_back_get_ptr ( m_vecCandidates, prevCandidate );
16291629 if ( prevCandidate.m_type == ICECandidateKind::Host )
@@ -1656,7 +1656,7 @@ void CSteamNetworkingICESession::STUNRequestCallback_ServerReflexiveCandidate( c
16561656 for ( int i = 0 ; i < len (m_vecCandidates) ; ++i )
16571657 {
16581658 ICELocalCandidate& c = m_vecCandidates[i];
1659- if ( c.m_type == ICECandidateKind::ServerReflexive && c.m_base == localAddr )
1659+ if ( c.m_type == ICECandidateKind::ServerReflexive && c.m_pInterface == pIntf )
16601660 {
16611661 // Another response for a candidate we already have.
16621662
@@ -1719,11 +1719,10 @@ void CSteamNetworkingICESession::STUNRequestCallback_ServerReflexiveKeepAlive( c
17191719 ICESessionInterface * const pIntf = info.m_pRequest ->m_pInterface ;
17201720 pIntf->m_pPendingSTUNRequest = nullptr ;
17211721
1722- const SteamNetworkingIPAddr &localAddr = pIntf->m_pSocket ->m_boundAddr ;
17231722 ICELocalCandidate *pCandidate = nullptr ;
17241723 for ( ICELocalCandidate& c : m_vecCandidates )
17251724 {
1726- if ( c.m_type == ICECandidateKind::ServerReflexive && c.m_base == localAddr )
1725+ if ( c.m_type == ICECandidateKind::ServerReflexive && c.m_pInterface == pIntf )
17271726 {
17281727 pCandidate = &c;
17291728 break ;
@@ -1820,7 +1819,7 @@ void CSteamNetworkingICESession::Think_TestPeerConnectivity()
18201819 }
18211820 if ( bFound )
18221821 continue ;
1823- if ( localCandidate.m_base .IsIPv4 () != remoteCandidate.m_addr .IsIPv4 () )
1822+ if ( localCandidate.m_pInterface -> m_pSocket -> m_boundAddr .IsIPv4 () != remoteCandidate.m_addr .IsIPv4 () )
18241823 continue ;
18251824
18261825 if ( !bFound )
@@ -2050,7 +2049,6 @@ CSteamNetworkingICESession::ICECandidateBase::ICECandidateBase( ICECandidateKind
20502049CSteamNetworkingICESession::ICELocalCandidate::ICELocalCandidate ( ICECandidateKind t, const SteamNetworkingIPAddr& addr, ICESessionInterface *pInterface )
20512050 : ICECandidateBase( t, addr )
20522051 , m_pInterface( pInterface )
2053- , m_base( pInterface->m_pSocket->m_boundAddr )
20542052{
20552053 m_stunServer.Clear ();
20562054}
@@ -2092,13 +2090,14 @@ void CSteamNetworkingICESession::ICELocalCandidate::CalcCandidateAttribute( char
20922090 server.*/
20932091 uint32 nFoundation = 0 ;
20942092 {
2093+ const SteamNetworkingIPAddr &base = m_pInterface->m_pSocket ->m_boundAddr ;
20952094 uint16 uCounter = 0 ;
20962095 for ( int i = 0 ; i < 16 ; ++i )
20972096 {
2098- uCounter += m_base .m_ipv6 [i];
2097+ uCounter += base .m_ipv6 [i];
20992098 uCounter += m_stunServer.m_ipv6 [i];
21002099 }
2101- nFoundation = ( m_base .m_port + m_stunServer.m_port ) + ( uCounter << 15 ) + (int )m_type;
2100+ nFoundation = ( base .m_port + m_stunServer.m_port ) + ( uCounter << 15 ) + (int )m_type;
21022101 }
21032102 char connectionAddr[ SteamNetworkingIPAddr::k_cchMaxString];
21042103 m_addr.ToString ( connectionAddr, V_ARRAYSIZE ( connectionAddr ), false );
@@ -2294,7 +2293,7 @@ void CConnectionTransportP2PICE_Valve::OnConnectionSelected( const CSteamNetwork
22942293 && remoteCandidate.m_type == ICECandidateKind::Host )
22952294 {
22962295 int nPrefixLen = localCandidate.m_pInterface ->m_nPrefixLen ;
2297- if ( IsRemoteAddressOnLocalSubnet ( localCandidate.m_base , nPrefixLen, remoteCandidate.m_addr ) )
2296+ if ( IsRemoteAddressOnLocalSubnet ( localCandidate.m_pInterface -> m_pSocket -> m_boundAddr , nPrefixLen, remoteCandidate.m_addr ) )
22982297 m_eCurrentRouteKind = k_ESteamNetTransport_UDPProbablyLocal;
22992298 }
23002299 m_pingEndToEnd.Reset ();
0 commit comments