Skip to content
Snippets Groups Projects
Commit b5fba934 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Adrien Béraud
Browse files

ice: log warn when no public IPv4 present in DHT msg

This is a helper to detect cases where the connection cannot
be established due to absence of public addresses.

Change-Id: Ibfdc221624f5edc9e8e0b9bcebc35e2b5335770f
parent deffff6d
No related branches found
No related tags found
No related merge requests found
......@@ -487,6 +487,9 @@ IceTransport::start(const std::vector<uint8_t>& rem_data)
return false;
}
if (onlyIPv4Private_)
RING_WARN("[ice:%p] no public IPv4 found, your connection may fail!", this);
return start({rem_ufrag, rem_pwd}, rem_candidates);
}
......@@ -854,8 +857,10 @@ IceTransport::getCandidateFromSDP(const std::string& line, IceCandidate& cand)
if (strchr(ipaddr, ':'))
af = pj_AF_INET6();
else
else {
af = pj_AF_INET();
onlyIPv4Private_ &= IpAddr(ipaddr).isPrivate();
}
tmpaddr = pj_str(ipaddr);
pj_sockaddr_init(af, &cand.addr, NULL, 0);
......
......@@ -297,6 +297,8 @@ class IceTransport {
std::unique_ptr<upnp::Controller> upnp_;
bool onlyIPv4Private_ {true};
// IO/Timer events are handled by following thread
std::thread thread_;
std::atomic_bool threadTerminateFlags_ {false};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment