@@ -1372,21 +1372,9 @@ defmodule ExICE.Priv.ICEAgentTest do
13721372 end
13731373
13741374 test "success response with the xor address of a local candidate with a different socket." do
1375- # This test checks a specific scenario where one of the local candidates uses a socket opened on a bridge interface:
1376-
1377- # L - local side
1378- # R - remote side
1379- # RC1 - remote candidate
1380-
1381- # 1. L opens socket on interface 1 (I1), port 5000 - first local candidate (LC1)
1382- # 2. L opens socket on interface 2 (I2), port 5000 - second local candidate (LC2)
1383- # 3. L sends a connection check from LC1 to RC1. Given LC1 operates via I1, which is a bridge interface, its source address is rewritten to I2
1384- # 4. R perceives the request from L as originating from I2, port 5000, and responds successfully to I2, port 5000
1385- # 5. This response arrives to the I1 port 5000. L notices that R recognized it as coming from I2, port 5000
1386- # 6. L chooses to use LC1 and RC1 as the discovered pair because we know that I1 is a bridge interface.
1387-
1388- # Note: If we were to use LC2 and RC1 as the discovered pair
1389- # we would have different sockets between the succeeded and discovered pairs, which would cause a runtime error.
1375+ # 1. L sends a binding request using the {LC1, RC1} pair.
1376+ # 2. L receives a binding response with an XOR address LC2, which utilizes a different socket.
1377+ # 3. L selects the {LC1, RC2} pair as the discovered pair.
13901378
13911379 # Setup ice_agent to have two local candidates
13921380 ice_agent =
@@ -1406,7 +1394,7 @@ defmodule ExICE.Priv.ICEAgentTest do
14061394
14071395 # find candidate pair on which connectivity check was sent
14081396 { _pair_id , pair } =
1409- Enum . find ( ice_agent . checklist , fn { _pair_id , pair } -> pair . state == :in_progress end )
1397+ Enum . filter ( ice_agent . checklist , fn { _pair_id , pair } -> pair . state == :in_progress end )
14101398
14111399 local_cand = Map . fetch! ( ice_agent . local_cands , pair . local_cand_id )
14121400 req = read_binding_request ( local_cand . base . socket , ice_agent . remote_pwd )
@@ -1434,7 +1422,8 @@ defmodule ExICE.Priv.ICEAgentTest do
14341422 |> Map . values ( )
14351423 |> Enum . sort ( & ( & 1 . priority > & 2 . priority ) )
14361424
1437- # verify that discovered pair is the same as succeeded
1425+ # verify that because these two paris use local candidates with different sockets,
1426+ # they are not linked together via succeeded/discovered pair ids
14381427 assert pair_1 . state == :succeeded
14391428 assert pair_1 . id == pair_1 . succeeded_pair_id
14401429 assert pair_1 . succeeded_pair_id == pair_1 . discovered_pair_id
0 commit comments