Skip to content

Add support for network interfaces in mDNS configuration#3159

Closed
cpeliciari wants to merge 2 commits intolibp2p:masterfrom
cpeliciari:feat/add-mdns-support-network
Closed

Add support for network interfaces in mDNS configuration#3159
cpeliciari wants to merge 2 commits intolibp2p:masterfrom
cpeliciari:feat/add-mdns-support-network

Conversation

@cpeliciari
Copy link
Copy Markdown
Contributor

This commit addresses an issue encountered on Android devices when using the [zeroconf] package, which results in the following error:

[zeroconf] no suitable IPv4 interface: udp4: failed to join any of these interfaces: []

The root cause of this issue is that the zeroconf package fails to properly detect network interfaces on Android. To resolve this, I have implementation with anet, which includes a fix specifically targeting Android compatibility.

Additionally, a similar issue exists in the package github.com/multiformats/go-multiaddr, where it fails to handle network interfaces correctly on Android. I worked around this issue with the following commit:

8491a6c56a51cc4dec517388f4f044d939896984

@MarcoPolo
Copy link
Copy Markdown
Collaborator

For the same reasons that multiformats/go-multiaddr#255 is open, we don't want to use the anet package here.

A preferred change would be to add an option to provide a custom .Interfaces() method. User's can then use anet to implement that method.

@MarcoPolo
Copy link
Copy Markdown
Collaborator

A similar solution would be welcome in go-multiaddr btw.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants