Also, the format for non-global addresses might conflict with the URI syntax [13], since the syntax defines the delimiter character (`%') as the escape character. This conflict would require, for example, that the <zone_id> part for zone 1 with the delimiter be represented as '%251'. It also means that we could not simply copy a non-escaped format from other sources as input to the URI parser. Additionally, if the URI parser does not convert the escaped format before passing it to a name-to-address library, the conversion will fail. All these issues would decrease the benefit of the textual representation described in this section.
Yes, we handle the required escaping properly, the issue here seems to be that even escaped non-ASCII characters aren't accepted. The RFC in question has this as a SHOULD but apparently the Go parser is more strict. We've had previous issues with this. Relevant:
changed the title [-]Syncthing floods standard output with 'invalid URL escape' messages[/-][+]IPv6 addresses with localized zone identifiers cause 'invalid URL escape' messages on Windows[/+]on Apr 16, 2021
Does golang provide something comparable to if_nametoindex ? Looks like IPv6 link local addresses can also be expressed with the index of the network interface:
Activity
bt90 commented on Apr 16, 2021
https://tools.ietf.org/html/rfc4007#section-11.7
So the parser needs to support RFC6874
calmh commented on Apr 16, 2021
Yes, we handle the required escaping properly, the issue here seems to be that even escaped non-ASCII characters aren't accepted. The RFC in question has this as a SHOULD but apparently the Go parser is more strict. We've had previous issues with this. Relevant:
https://github.com/golang/go/blob/d26fc68aa10dc8eda5ccdcc80d790e7df2fd9823/src/net/url/url.go#L223-L235
The "seems prudent" there might not be very prudent after all and it could be argued that this should be fixed...
Also, Windows, FFS... Why couldn't they just have stuck a guid or something in the zone identifier, that seems like the Windows way. 🤷
bt90 commented on Apr 16, 2021
@calmh is the URI being parsed here one published by some other device?
calmh commented on Apr 16, 2021
It's the source address of the incoming packet as reported by (*net.UDPConn).ReadFrom() (or such) put into the host portion of a net.URL.
bt90 commented on Apr 16, 2021
Is the link local IP dialable without the identifier?
calmh commented on Apr 16, 2021
Certainly not. (It's link scoped.)
bt90 commented on Apr 16, 2021
Does golang provide something comparable to if_nametoindex ? Looks like IPv6 link local addresses can also be expressed with the index of the network interface:
fe80::4d3d:3426:46e6:1457%2
calmh commented on Apr 16, 2021
You could check it out, this seems to be an issue close to your interests. :)
AudriusButkevicius commented on Apr 16, 2021
I'm not conviced that is true on windows.
bt90 commented on Apr 16, 2021
ipconfig lists my link local IPv6 address by default with the index 😉
bt90 commented on Apr 16, 2021
Seems like this mapping is also supported by the go standard library: https://golang.org/pkg/net/#Interface