diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index b216d8f5b..b15d6ca40 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -687,7 +687,8 @@ bytes Host::saveNodes() const for (auto const& i: m_nodes) { Node const& n = *(i.second); - if (!n.dead && n.address.port() > 0 && n.address.port() >= 30300 && n.address.port() <= 30305 && n.id != id() && !isPrivateAddress(n.address.address())) + // TODO: PoC-7: Figure out why it ever shares these ports.//n.address.port() >= 30300 && n.address.port() <= 30305 && + if (!n.dead && n.address.port() > 0 && n.address.port() < 49152 && n.id != id() && !isPrivateAddress(n.address.address())) { nodes.appendList(10); if (n.address.address().is_v4()) diff --git a/libp2p/Session.cpp b/libp2p/Session.cpp index 42a3dff89..3860b34c3 100644 --- a/libp2p/Session.cpp +++ b/libp2p/Session.cpp @@ -326,10 +326,13 @@ bool Session::interpret(RLP const& _r) if (!ep.port()) goto CONTINUE; // Zero port? Don't think so. + if (ep.port() >= 49152) + goto CONTINUE; // Private port according to IANA. + // TODO: PoC-7: // Technically fine, but ignore for now to avoid peers passing on incoming ports until we can be sure that doesn't happen any more. - if (ep.port() < 30300 || ep.port() > 30305) - goto CONTINUE; // Wierd port. +// if (ep.port() < 30300 || ep.port() > 30305) +// goto CONTINUE; // Wierd port. // Avoid our random other addresses that they might end up giving us. for (auto i: m_server->m_addresses)