Skip to content
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

Listen 0.0.0.0 only on IPv4 #2553

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Listen 0.0.0.0 only on IPv4 #2553

merged 1 commit into from
Feb 27, 2024

Conversation

lifenjoiner
Copy link
Member

For

## To listen to all IPv4 addresses, use `listen_addresses = ['0.0.0.0:53']`
## To listen to all IPv4+IPv6 addresses, use `listen_addresses = ['[::]:53']`

Maybe golang's behavior on this had changed some time ago.
Currently, listen to 0.0.0.0 will be on both IPv4 and IPv6 interfaces, the same as ::.
https://github.com/golang/go/blob/9b4b3e5acca2dabe107fa2c3ed963097d78a4562/src/net/ipsock_posix.go#L129

@lifenjoiner
Copy link
Member Author

Or change the comments instead?

@jedisct1
Copy link
Member

jedisct1 commented Feb 26, 2024

Is this not relevant any more?

0.0.0.0 should listen only to IPv4, this is the original behavior and what most people would expect.

@lifenjoiner
Copy link
Member Author

Didn't get any response, I guess you are expecting some better solution.
Frankly, my patch is not elegant, just simple and works, together with the context.
I don't get a more concise one. A wrapper should be common enough. That will be complicated and indirect.
If you don't opposite. I will solve the conflict and merge.

@lifenjoiner lifenjoiner reopened this Feb 26, 2024
@lifenjoiner lifenjoiner merged commit ac50873 into DNSCrypt:master Feb 27, 2024
1 of 3 checks passed
@lifenjoiner lifenjoiner deleted the 4z branch February 27, 2024 11:04
@lifenjoiner lifenjoiner restored the 4z branch February 27, 2024 13:57
@DNSCrypt DNSCrypt locked and limited conversation to collaborators Mar 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants