mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
fix Jan 22 regression in parsing port numbers from pex
This commit is contained in:
parent
ac823f3cc4
commit
81066aae25
1 changed files with 8 additions and 4 deletions
|
@ -1209,8 +1209,10 @@ std::vector<tr_pex> tr_peerMgrCompactToPex(void const* compact, size_t compactLe
|
|||
for (size_t i = 0; i < n; ++i)
|
||||
{
|
||||
pex[i].addr.type = TR_AF_INET;
|
||||
walk = std::copy_n(walk, 4, reinterpret_cast<std::byte*>(&pex[i].addr.addr));
|
||||
walk = std::copy_n(walk, 2, reinterpret_cast<std::byte*>(&pex[i].port));
|
||||
std::copy_n(walk, 4, reinterpret_cast<std::byte*>(&pex[i].addr.addr));
|
||||
walk += 4;
|
||||
std::copy_n(walk, 2, reinterpret_cast<std::byte*>(&pex[i].port));
|
||||
walk += 2;
|
||||
|
||||
if (added_f != nullptr && n == added_f_len)
|
||||
{
|
||||
|
@ -1259,8 +1261,10 @@ std::vector<tr_pex> tr_peerMgrCompact6ToPex(void const* compact, size_t compactL
|
|||
for (size_t i = 0; i < n; ++i)
|
||||
{
|
||||
pex[i].addr.type = TR_AF_INET6;
|
||||
walk = std::copy_n(walk, 16, reinterpret_cast<std::byte*>(&pex[i].addr.addr.addr6.s6_addr));
|
||||
walk = std::copy_n(walk, 2, reinterpret_cast<std::byte*>(&pex[i].port));
|
||||
std::copy_n(walk, 16, reinterpret_cast<std::byte*>(&pex[i].addr.addr.addr6.s6_addr));
|
||||
walk += 16;
|
||||
std::copy_n(walk, 2, reinterpret_cast<std::byte*>(&pex[i].port));
|
||||
walk += 2;
|
||||
|
||||
if (added_f != nullptr && n == added_f_len)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue