New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: encode ip
in network byte order for udp announce
#6126
Conversation
!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 for the simple, straightforward fix.
Just brainstorming here... the code smell that sticks out to me that made this bug possible is that announce_ip
is in a raw uint32_t type. The reason this doesn't happen to ports is because of the tr_port
class that always gets byte ordering right. What if there was a tr_buffer::add_addr(tr_address const&);
method similar to tr_buffer::add_port()
? (...and if there was, would it actually work for all the places where we write an address?)
Yeah, why not? It should work, otherwise |
Is it worth releasing an update so all 4.0.x users aren't advertising incorrect addresses to trackers? |
I think so, this fix warrants another |
Fixes #6125.
Notes: Fixed
4.0.0
bug where theIP address
field in UDP announces are not encoded in network byte order. [BEP-15]