Do not spam "Connect failed with 101/65" in logs.
WebRTC polls the list of local IP addresses for both IPv4 and IPv6 every ~2 seconds. It does so by trying to connect() a UDP socket to an address on the public Internet (without actually sending any packets). If the host doesn't have IPv6 (or IPv4) connectivity, it fails with errno 101 (ENETUNREACH, Linux) or errno 65 (EHOSTUNREACH, Mac). This is the expected behavior, and we shouldn't be logging these failures, especially since polling is fairly frequent. BUG=webrtc:6347 R=deadbeef@webrtc.org, honghaiz@webrtc.org, perkj@webrtc.org Review URL: https://codereview.webrtc.org/2370383002 . Cr-Commit-Position: refs/heads/master@{#14440}
This commit is contained in:
parent
591c709fcb
commit
7502401788
@ -839,7 +839,12 @@ IPAddress BasicNetworkManager::QueryDefaultLocalAddress(int family) const {
|
||||
if (socket->Connect(SocketAddress(
|
||||
family == AF_INET ? kPublicIPv4Host : kPublicIPv6Host, kPublicPort)) <
|
||||
0) {
|
||||
LOG(LS_INFO) << "Connect failed with " << socket->GetError();
|
||||
if (socket->GetError() != ENETUNREACH
|
||||
&& socket->GetError() != EHOSTUNREACH) {
|
||||
// Ignore the expected case of "host/net unreachable" - which happens if
|
||||
// the network is V4- or V6-only.
|
||||
LOG(LS_INFO) << "Connect failed with " << socket->GetError();
|
||||
}
|
||||
return IPAddress();
|
||||
}
|
||||
return socket->GetLocalAddress().ipaddr();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user