Skip to content
Snippets Groups Projects
Commit e34f3ca7 authored by Sébastien Blin's avatar Sébastien Blin Committed by Philippe Gorley
Browse files

tests: fix test_TURN


permitPeer was failing because of a bad parsing.
Here we should use the ipv4 mapped address.

Change-Id: If286afc54efc99f8828c6379a6264c9da4285d75
Reviewed-by: default avatarPhilippe Gorley <philippe.gorley@savoirfairelinux.com>
parent 9c44d59f
Branches
No related tags found
No related merge requests found
...@@ -20,11 +20,12 @@ ...@@ -20,11 +20,12 @@
#include "test_TURN.h" #include "test_TURN.h"
#include "turn_transport.h" #include "turn_transport.h"
#include <chrono>
#include <opendht/sockaddr.h>
#include <stdexcept>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/unistd.h> #include <sys/unistd.h>
#include <stdexcept>
#include <thread> #include <thread>
#include <chrono>
#include <vector> #include <vector>
using namespace ring; using namespace ring;
...@@ -99,7 +100,8 @@ test_TURN::testSimpleConnection() ...@@ -99,7 +100,8 @@ test_TURN::testSimpleConnection()
TCPSocket sock = {param.server.getFamily()}; TCPSocket sock = {param.server.getFamily()};
// Permit myself // Permit myself
turn.permitPeer(turn.mappedAddr()); auto mapped = static_cast<dht::SockAddr>(turn.mappedAddr());
turn.permitPeer(IpAddr { mapped.getMappedIPv4().toString() });
std::this_thread::sleep_for(std::chrono::seconds(2)); std::this_thread::sleep_for(std::chrono::seconds(2));
sock.connect(turn.peerRelayAddr()); sock.connect(turn.peerRelayAddr());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment