diff options
author | Doug Huff <mith@jrbobdobbs.org> | 2011-06-02 14:46:41 -0500 |
---|---|---|
committer | Doug Huff <mith@jrbobdobbs.org> | 2011-06-02 14:46:41 -0500 |
commit | 482cb6569058423ca952076459f1539a88d70074 (patch) | |
tree | 51ea99402d8a958551c3ac7cbcb8726a40466e61 /src/net.cpp | |
parent | e104c7937455bf2c9b535ec14ea710a97b66750b (diff) |
Fix rfc1918 and rfc3927 compliance for ignoring non-internet-routable hosts.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp index 654fe0cad5..39360a334c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -88,8 +88,7 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet) setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int)); #endif - bool fRoutable = !(addrConnect.GetByte(3) == 10 || (addrConnect.GetByte(3) == 192 && addrConnect.GetByte(2) == 168)); - bool fProxy = (fUseProxy && fRoutable); + bool fProxy = (fUseProxy && addrConnect.IsRoutable()); struct sockaddr_in sockaddr = (fProxy ? addrProxy.GetSockAddr() : addrConnect.GetSockAddr()); if (connect(hSocket, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR) |