Scoring loopback addresses as 0 in DefaultChannelId
Motivation: As described in #3490, [compareAddresses](https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/channel/DefaultChannelId.java#L182) seems to allow loopback addresses to score high, disallowing replacing the loopback address. Modifications: Changed [scoreAddress](https://github.com/netty/netty/blob/master/transport/src/main/java/io/netty/channel/DefaultChannelId.java#L283) to score loopback addresses as 0. Result: Fixes #3490
This commit is contained in:
parent
c88de88c4d
commit
dca6cea78e
@ -280,7 +280,7 @@ final class DefaultChannelId implements ChannelId {
|
||||
}
|
||||
|
||||
private static int scoreAddress(InetAddress addr) {
|
||||
if (addr.isAnyLocalAddress()) {
|
||||
if (addr.isAnyLocalAddress() || addr.isLoopbackAddress()) {
|
||||
return 0;
|
||||
}
|
||||
if (addr.isMulticastAddress()) {
|
||||
|
Loading…
Reference in New Issue
Block a user