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

Expose service to both IPv4 and IPv6 #1307

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

AndersBallegaard
Copy link

Change to listen to [::0] given this will make the application listen on both ipv4 and ipv6. This is useful to enable support for ipv6 only networks.
Given most users will be on v4 only or dual stacked networks it is of course important to make sure that works, in my testing i have not found any case where this change created a problem for those devices.

@kingosticks
Copy link
Contributor

in my testing i have not found any case where this change created a problem for those devices.

Just so it's clear, what patforms did you test?

@Frankkkkk
Copy link

"Technically", I guess this would fail on platforms where the IPv6 stack doesn't exist (i.e. if you compile the kernel by explicitly disabling IPv6, which I guess nobody does unless you want to torture yourself). But I guess the number of people doing that is way smaller that the people that want/need IPv6 (i.e. those using NAT64, etc..)

@roderickvd
Copy link
Member

Looks good to me. Can you add an entry to the changelog? Then we can merge.

@willstott101
Copy link
Contributor

This doesn't work for IPv4 on Windows :( Dual-stack sockets aren't the default.

Perhaps best to use Ipv6Addr::UNSPECIFIED.into() only on non-windows?

@Frankkkkk
Copy link

Frankkkkk commented Aug 24, 2024 via email

Copy link
Member

@roderickvd roderickvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to #1307 (comment) and add an entry to the changelog. Thanks!

@@ -251,7 +252,7 @@ pub struct DiscoveryServer {
impl DiscoveryServer {
pub fn new(config: Config, port: &mut u16) -> Result<Self, Error> {
let (discovery, cred_rx) = RequestHandler::new(config);
let address = SocketAddr::new(Ipv4Addr::UNSPECIFIED.into(), *port);
let address = SocketAddr::new(IpAddr::from_str("::0").unwrap(), *port);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to: #1307 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants