diff options
| author | Giel van Schijndel <[email protected]> | 2012-05-20 17:46:44 +0200 |
|---|---|---|
| committer | Giel van Schijndel <[email protected]> | 2012-05-25 07:27:24 +0200 |
| commit | 7cc2ceae09d7b36f9054e8f57c1fa7ba87e21171 (patch) | |
| tree | 4de8d009524fbe845ad0149afd71a1425bc22759 /src | |
| parent | Generalise RPC connection handling code to allow more listening sockets (diff) | |
| download | discoin-7cc2ceae09d7b36f9054e8f57c1fa7ba87e21171.tar.xz discoin-7cc2ceae09d7b36f9054e8f57c1fa7ba87e21171.zip | |
Allow all addresses on the loopback subnet (127.0.0.0/8) not just 127.0.0.1
Signed-off-by: Giel van Schijndel <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/bitcoinrpc.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 8a278070c..bd7cb3ef4 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -2558,7 +2558,10 @@ bool ClientAllowed(const boost::asio::ip::address& address) return ClientAllowed(address.to_v6().to_v4()); if (address == asio::ip::address_v4::loopback() - || address == asio::ip::address_v6::loopback()) + || address == asio::ip::address_v6::loopback() + || (address.is_v4() + // Chech whether IPv4 addresses match 127.0.0.0/8 (loopback subnet) + && (address.to_v4().to_ulong() & 0xff000000) == 0x7f000000)) return true; const string strAddress = address.to_string(); |