GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Only include scopeId on link-local addresses when using native transport by normanmaurer · Pull Request #14188 · netty/netty

Conversation

@normanmaurer

@normanmaurer normanmaurer commented Jul 17, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@normanmaurer
Only include scopeId on link-local addresses when using native transport
beb851c
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
@normanmaurer normanmaurer added this to the 4.1.112.Final milestone Jul 17, 2024
@normanmaurer
normanmaurer requested review from bryce-anderson, chrisvest and idelpivnitskiy July 17, 2024 15:47
@normanmaurer
Fix checkstyle
4aca40b
@normanmaurer

normanmaurer commented Jul 17, 2024

Copy link
Copy Markdown
Member Author

This was found as part of https://issues.apache.org/jira/browse/HBASE-27304

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@normanmaurer

normanmaurer commented Jul 17, 2024

Copy link
Copy Markdown
Member Author

Fixes #14189

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bryce-anderson
bryce-anderson reviewed Jul 17, 2024
View reviewed changes
Comment thread transport-native-unix-common/src/main/java/io/netty/channel/unix/NativeInetAddress.java
Comment on lines +93 to +100
// 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);
}

@bryce-anderson bryce-anderson Jul 17, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@normanmaurer normanmaurer Jul 17, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
chrisvest
chrisvest approved these changes Jul 17, 2024
View reviewed changes
bryce-anderson
bryce-anderson approved these changes Jul 17, 2024
View reviewed changes

@bryce-anderson bryce-anderson left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@normanmaurer
normanmaurer merged commit 5e2d384 into 4.1 Jul 18, 2024
@normanmaurer
normanmaurer deleted the scope_41 branch July 18, 2024 20:16
normanmaurer added a commit that referenced this pull request Jul 18, 2024
@normanmaurer
Only include scopeId on link-local addresses when using native transp…
6a7e883
…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
normanmaurer added a commit that referenced this pull request Jul 18, 2024
@normanmaurer
Only include scopeId on link-local addresses when using native transp…
0170795
…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
This was referenced Sep 14, 2026
Http2: Reserve promised stream for PUSH_PROMISE after local RST_STREAM #17471
Closed
cache failure 1233e4a5 #17565
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chrisvest chrisvest chrisvest approved these changes
@bryce-anderson bryce-anderson bryce-anderson approved these changes
@idelpivnitskiy idelpivnitskiy Awaiting requested review from idelpivnitskiy

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

4.1.112.Final

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@normanmaurer @chrisvest @bryce-anderson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.