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

feat: add receive interface information #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jclab-joseph
Copy link

@jclab-joseph jclab-joseph commented Dec 6, 2023

For libp2p/go-libp2p#2661

In the case of link-local address, the interface must be bound.
Include the received interface in a ServiceEntry.

Additionally, when using a bridge, slave interfaces should not be used:
https://github.com/libp2p/zeroconf/pull/35/files#diff-25a7cf08cc8fc8eb57475835cc380524de2fd1215cda9c6915132ae86dbd80a7R117-R121

@marten-seemann
Copy link

I don’t understand this PR. Can you please explain what you’re trying to achieve?

We avoid making changes to this repo unless absolutely necessary.

@jclab-joseph
Copy link
Author

@marten-seemann

Described at libp2p/go-libp2p#2660 (comment)

As an example, an IoT node before IP is set can use it to communicate via p2p.
IPv6 link-local address can be used even if a static IP is not set.
In this case, you can communicate by searching for each other using mdns, etc. within the local network.

@marten-seemann
Copy link

I don’t understand how that would work. What’s the address you’d advertise in that case? Can you give an example here?

@jclab-joseph
Copy link
Author

jclab-joseph commented Dec 7, 2023

@marten-seemann

This is a fully working example.
https://github.com/jclab-joseph/libp2p-link-local-demo/tree/ipv6-link-address-with-mdns

what has changed: https://github.com/jclab-joseph/libp2p-link-local-demo/pull/1/files

mdns packet:
image

After finding out the received interface using ifIndex or Zone, connect to /ip6zone/{interface name}/{txt}.

@marten-seemann
Copy link

This seems to be a fix for grandcat#51.

Since we're only maintaining a fork of zeroconf to support some API changes, we won't merge this PR, unless the fix is upstreamed to the upstream repo. @jclab-joseph, please open a PR in the original repo, and once it's merged there, we can cherry-pick that commit onto our fork here.

@jclab-joseph
Copy link
Author

grandcat#117

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.

2 participants