Skip to content

Commit 7b6d0f1

Browse files
committed
Remove old check for 3-byte shifted IP addresses from pre-0.2.9 node messages
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.
1 parent 8d6224f commit 7b6d0f1

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/netaddress.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -269,17 +269,6 @@ bool CNetAddr::IsLocal() const
269269
*/
270270
bool CNetAddr::IsValid() const
271271
{
272-
// Cleanup 3-byte shifted addresses caused by garbage in size field
273-
// of addr messages from versions before 0.2.9 checksum.
274-
// Two consecutive addr messages look like this:
275-
// header20 vectorlen3 addr26 addr26 addr26 header20 vectorlen3 addr26 addr26 addr26...
276-
// so if the first length field is garbled, it reads the second batch
277-
// of addr misaligned by 3 bytes.
278-
if (IsIPv6() && memcmp(m_addr.data(), IPV4_IN_IPV6_PREFIX.data() + 3,
279-
sizeof(IPV4_IN_IPV6_PREFIX) - 3) == 0) {
280-
return false;
281-
}
282-
283272
// unspecified IPv6 address (::/128)
284273
unsigned char ipNone6[16] = {};
285274
if (IsIPv6() && memcmp(m_addr.data(), ipNone6, sizeof(ipNone6)) == 0) {

0 commit comments

Comments
 (0)