GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||
GeezerVison is showing github.com — Only include scopeId on link-local addresses when using native transport by normanmaurer · Pull Request #14188 · netty/netty Conversation
|
|
This was found as part of https://issues.apache.org/jira/browse/HBASE-27304 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Fixes #14189 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| // Only include the scopeId if its either non 0 or if this is a link-local address | ||
| // as scopeId is only supported with it: | ||
| // See also https://man7.org/linux/man-pages/man7/ipv6.7.html | ||
| if (scopeId != 0 || (ipv6[0] == (byte) 0xfe && ipv6[1] == (byte) 0x80)) { | ||
| address = Inet6Address.getByAddress(null, ipv6, scopeId); | ||
| } else { | ||
| address = InetAddress.getByAddress(null, ipv6); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Reading through the man page, it sounds like scope is only supported for link-local addresses. Does that means we should omit the scope, even non-zero scope, if the address is not link local?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I asked myself the same but then decided against it as we should only fill it with non-zero when the underlying OS tells us so..
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
While I'm approving, I'm certainly not an expert in ipv6 details so if you're not confident maybe wait for a more authoritative review before shipping.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ort (#14188) Motivation: We should only include the scopeId when the address is link-local or the scopeId was explicit something different then 0. Otherwise we might get into trouble if people don't expect it included Modifications: Ensure we only construct a InetAddress with scopeId if its a non link-local address or it was explicit set by the underlying OS Fixes #14184 , #14189
…ort (#14188) Motivation: We should only include the scopeId when the address is link-local or the scopeId was explicit something different then 0. Otherwise we might get into trouble if people don't expect it included Modifications: Ensure we only construct a InetAddress with scopeId if its a non link-local address or it was explicit set by the underlying OS Fixes #14184 , #14189
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.