Skip to content

Conversation

@cyclinder
Copy link
Contributor

@cyclinder cyclinder commented Oct 18, 2024

What is the purpose of the change?

NetUtils: should be ignore link-local address

Fixes #14792

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@heliang666s
Copy link
Member

LGTM

@cyclinder cyclinder changed the title Fix NetUtils: should be link-local address Fix NetUtils: should be ignore link-local address Oct 18, 2024

static boolean isValidV4Address(InetAddress address) {
if (address == null || address.isLoopbackAddress()) {
if (address == null || address.isLoopbackAddress() || address.isLinkLocalAddress()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if there is no any non-local interface

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there is no non-local address, address.isLinkLocalAddress() would return false, This function wouldn't return directly, Continue with the logic below, same as if it was a lookback address.


static boolean isValidV4Address(InetAddress address) {
if (address == null || address.isLoopbackAddress()) {
if (address == null || address.isLoopbackAddress() || address.isLinkLocalAddress()) {
Copy link

@yunmaoQu yunmaoQu Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlbumenJ Just suggesstion:add a parameter called "allowLinkLocal(boolean)" in some related method( i find two extend point from original structure) .And user can config the value in system config file while it's default value is true to prevent the situation that though there is no any non-local interface and it also work , it's ok?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've done the work in local,if my idea is available and need my code ,i 'll push a request under this issue!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to https://github.com/apache/dubbo/pull/14793/files#r1814182854, address.isLinkLocalAddress() shouldn't affect if there is no non-local address. I don't have a Dubbo environment locally, Can you help test the changes? thanks a lot.

@zrlw zrlw added help wanted Everything needs help from contributors type/enhancement Everything related with code enhancement or performance labels Jun 24, 2025
@zrlw zrlw changed the title Fix NetUtils: should be ignore link-local address Fix NetUtils: should ignore link-local address Jun 24, 2025
@zrlw zrlw merged commit e4c8fe9 into apache:3.3 Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Everything needs help from contributors type/enhancement Everything related with code enhancement or performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] NetUtils should ignore the local link address

5 participants