mirror of
https://github.com/transmission/transmission
synced 2024-12-27 18:18:10 +00:00
fix: broken detection of peer udp port (#4334)
This commit is contained in:
parent
389919f727
commit
f176bb299a
1 changed files with 3 additions and 3 deletions
|
@ -1637,9 +1637,9 @@ static ReadState readBtMessage(tr_peerMsgsImpl* msgs, size_t inlen)
|
|||
{
|
||||
logtrace(msgs, "Got a BtPeerMsgs::Port");
|
||||
|
||||
auto nport = uint16_t{};
|
||||
msgs->io->readUint16(&nport);
|
||||
if (auto const dht_port = tr_port::fromNetwork(nport); !std::empty(dht_port))
|
||||
auto hport = uint16_t{};
|
||||
msgs->io->readUint16(&hport); // readUint16 performs ntoh
|
||||
if (auto const dht_port = tr_port::fromHost(hport); !std::empty(dht_port))
|
||||
{
|
||||
msgs->dht_port = dht_port;
|
||||
msgs->session->addDhtNode(msgs->io->address(), msgs->dht_port);
|
||||
|
|
Loading…
Reference in a new issue