@@ -1372,21 +1372,9 @@ defmodule ExICE.Priv.ICEAgentTest do
1372
1372
end
1373
1373
1374
1374
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.
1390
1378
1391
1379
# Setup ice_agent to have two local candidates
1392
1380
ice_agent =
@@ -1406,7 +1394,7 @@ defmodule ExICE.Priv.ICEAgentTest do
1406
1394
1407
1395
# find candidate pair on which connectivity check was sent
1408
1396
{ _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 )
1410
1398
1411
1399
local_cand = Map . fetch! ( ice_agent . local_cands , pair . local_cand_id )
1412
1400
req = read_binding_request ( local_cand . base . socket , ice_agent . remote_pwd )
@@ -1434,7 +1422,8 @@ defmodule ExICE.Priv.ICEAgentTest do
1434
1422
|> Map . values ( )
1435
1423
|> Enum . sort ( & ( & 1 . priority > & 2 . priority ) )
1436
1424
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
1438
1427
assert pair_1 . state == :succeeded
1439
1428
assert pair_1 . id == pair_1 . succeeded_pair_id
1440
1429
assert pair_1 . succeeded_pair_id == pair_1 . discovered_pair_id
0 commit comments