aboutsummaryrefslogtreecommitdiff
path: root/src/netaddress.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-08-28 17:51:33 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-08-28 17:51:37 +0200
commit5edef20a65f05cb91b06bb0b308432c5dcbeca9a (patch)
tree2897dbae2f2220a050e05e651939eaec4ed66ba1 /src/netaddress.cpp
parent9632b7edc74834c3249d08e94f44d27a5db1f435 (diff)
parent7b6d0f10a7af7998f7cfcf3aeaa0269b61a321ce (diff)
downloadbitcoin-5edef20a65f05cb91b06bb0b308432c5dcbeca9a.tar.xz
Merge #19797: net: Remove old check for 3-byte shifted IP addresses from pre-0.2.9 nodes
7b6d0f10a7af7998f7cfcf3aeaa0269b61a321ce Remove old check for 3-byte shifted IP addresses from pre-0.2.9 node messages (Raúl Martínez (RME)) Pull request description: The change removes an old check for IPv6 addresses in range ::ff:ff00:0:0:0/72 that were created due to a bug in size field of addr messages for 0.2.8 nodes and before. This check is no longer needed as they are no more pre 0.2.9 nodes on the network (as per bitnodes network snapshot). Credits for discovering this go to sipa in https://github.com/bitcoin/bitcoin/pull/19628#discussion_r475907453 Thanks for the attention! ACKs for top commit: sipa: utACK 7b6d0f10a7af7998f7cfcf3aeaa0269b61a321ce vasild: ACK 7b6d0f1 Tree-SHA512: c5fab59dda2acafe143f607a4c5b636a54ac76fba651cad1ad1b09c94e88ab39503a31c2244c8f2664da68456c2a870c601d8894139c55cde9ece8161913ed2e
Diffstat (limited to 'src/netaddress.cpp')
-rw-r--r--src/netaddress.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/netaddress.cpp b/src/netaddress.cpp
index 8adfe38dc9..b50cf74069 100644
--- a/src/netaddress.cpp
+++ b/src/netaddress.cpp
@@ -270,17 +270,6 @@ bool CNetAddr::IsLocal() const
*/
bool CNetAddr::IsValid() const
{
- // Cleanup 3-byte shifted addresses caused by garbage in size field
- // of addr messages from versions before 0.2.9 checksum.
- // Two consecutive addr messages look like this:
- // header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26...
- // so if the first length field is garbled, it reads the second batch
- // of addr misaligned by 3 bytes.
- if (IsIPv6() && memcmp(m_addr.data(), IPV4_IN_IPV6_PREFIX.data() + 3,
- sizeof(IPV4_IN_IPV6_PREFIX) - 3) == 0) {
- return false;
- }
-
// unspecified IPv6 address (::/128)
unsigned char ipNone6[16] = {};
if (IsIPv6() && memcmp(m_addr.data(), ipNone6, sizeof(ipNone6)) == 0) {