-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Recognize more addresses as local #24316
Conversation
} | ||
else if (address.family() == Poco::Net::AddressFamily::IPv6) | ||
{ | ||
return true; |
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.
So now any ipv6 address will be treated as local or I missed something?
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.
Sorry, missed the check above.
I will add a unit test. |
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.
Quite hacky, but OK. It will solve the problem caused by strange Debian's decision.
5310584
to
87a7133
Compare
Fuzzer:
?? |
quota_dcl
hmm, but unrelated, just flaky and cannot work concurrently. |
No related failures. |
* But 127.{0,1}.{0,1}.{0,1} are treat as local addresses, | ||
* because they are used in Debian for localhost. | ||
*/ | ||
if (address.isLoopback()) |
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.
Hi @alesapin,
I am afraid this will work only for IP address 127.0.0.1, related to https://pocoproject.org/docs/Poco.Net.IPAddress.html#24435 where documentation says loopback address is 127.0.0.1 for IPv4, otherwise it will never reach the internal part of if statement. I have this trouble in docker environment and I have 127.0.1.1 in /etc/hosts and unfortunately is_local is still 0.
Thanks for hints!
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.
So rather poco docs are not in sync, and not clear what is happening in your case
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.
BTW - are you sure you use 21.7?
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.
Hi @filimonov, sorry i didn't catch the difference between code and docs in poco. Unfortunately no, I am using 21.6.4 - I have clickhouse running in docker and there is no 21.7 docker image at the moment. Once there is 21.7 I will check if it works.
At the moment I solved it by setting real IP address of the server in /etc/hosts instead of 127.0.1.1 and it works as expected.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Recognize IPv4 addresses like
127.0.1.1
as local. This is controversial and closes #23504. Michael Filimonov will test this feature.