Fix NetUtils: should ignore link-local address#14793
Conversation
Signed-off-by: cyclinder <kuocyclinder@gmail.com>
|
LGTM |
|
|
||
| static boolean isValidV4Address(InetAddress address) { | ||
| if (address == null || address.isLoopbackAddress()) { | ||
| if (address == null || address.isLoopbackAddress() || address.isLinkLocalAddress()) { |
There was a problem hiding this comment.
What would happen if there is no any non-local interface
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
i've done the work in local,if my idea is available and need my code ,i 'll push a request under this issue!
There was a problem hiding this comment.
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.
What is the purpose of the change?
NetUtils: should be ignore link-local address
Fixes #14792
Checklist