mirror of
https://github.com/transmission/transmission
synced 2024-12-30 19:46:56 +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");
|
logtrace(msgs, "Got a BtPeerMsgs::Port");
|
||||||
|
|
||||||
auto nport = uint16_t{};
|
auto hport = uint16_t{};
|
||||||
msgs->io->readUint16(&nport);
|
msgs->io->readUint16(&hport); // readUint16 performs ntoh
|
||||||
if (auto const dht_port = tr_port::fromNetwork(nport); !std::empty(dht_port))
|
if (auto const dht_port = tr_port::fromHost(hport); !std::empty(dht_port))
|
||||||
{
|
{
|
||||||
msgs->dht_port = dht_port;
|
msgs->dht_port = dht_port;
|
||||||
msgs->session->addDhtNode(msgs->io->address(), msgs->dht_port);
|
msgs->session->addDhtNode(msgs->io->address(), msgs->dht_port);
|
||||||
|
|
Loading…
Reference in a new issue