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

Current ipv6 implementation doesn't account for interface #134

Closed
R9295 opened this issue Jul 16, 2020 · 3 comments
Closed

Current ipv6 implementation doesn't account for interface #134

R9295 opened this issue Jul 16, 2020 · 3 comments
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) released status/ready Ready to be worked

Comments

@R9295
Copy link

R9295 commented Jul 16, 2020

Suppose this is my following multiaddr string:

/ip6/fe80::ba27:ebff:fecd:680b%wlp2s0/tcp/5001/p2p/QmVCTgLguTMHTAHKfxQSmML4nUgm33tMrWYKMGxyXeHsVn

After parsing, the host should be

fe80::ba27:ebff:fecd:680b%wlp2s0

but the interface and the % is omitted.

This means that ipv6 link/local addresses are not parsed correctly.
This also creates issues with libp2p-tcp, when attempting to bootstrap a node with a local "neighbor node" as the interface is omitted when converting the string to a multiaddr object.

I've started working on a fix, and will hopefully have a pull request soon, just thought of creating an issue before in case anyone else runs into this

See:
libp2p/js-libp2p-bootstrap#105

@jacobheun jacobheun added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue status/ready Ready to be worked labels Jul 21, 2020
@JonathanLorimer
Copy link

JonathanLorimer commented Dec 6, 2020

Just wanted to ask a question to clarify. I noticed in the protocols.csv that there is a ip6zone with multiaddr code 42. I am pretty sure the % syntax is part of that addr format. In which case you would have to prefix that address with ip6zone instead. It seems that this library doesn't support ip6zone anyways, so the issue is still valid, but just wanted to make that clarification.

@vogdb
Copy link
Contributor

vogdb commented Feb 18, 2022

Hi! The problem is that js-multiaddr currently does not support IPv6 with zone ID. I've opened a PR to fix that #226. Also see the specs PR multiformats/multiaddr#68 how it is supported now. Your url:

/ip6/fe80::ba27:ebff:fecd:680b%wlp2s0/tcp/5001/p2p/QmVCTgLguTMHTAHKfxQSmML4nUgm33tMrWYKMGxyXeHsVn

should be represented as

/ip6zone/wlp2s0/ip6/fe80::ba27:ebff:fecd:680b/tcp/5001/p2p/QmVCTgLguTMHTAHKfxQSmML4nUgm33tMrWYKMGxyXeHsVn

github-actions bot pushed a commit that referenced this issue Jan 17, 2023
## [11.3.0](v11.2.0...v11.3.0) (2023-01-17)

### Features

* support ip6zone ([#226](#226)) ([cfacedb](cfacedb)), closes [#134](#134)
@github-actions
Copy link

🎉 This issue has been resolved in version 11.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) released status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

4 participants