diff --git a/common/src/main/java/io/netty/util/internal/PlatformDependent.java b/common/src/main/java/io/netty/util/internal/PlatformDependent.java index 530f13bf05..a538c2e23a 100644 --- a/common/src/main/java/io/netty/util/internal/PlatformDependent.java +++ b/common/src/main/java/io/netty/util/internal/PlatformDependent.java @@ -459,7 +459,7 @@ public final class PlatformDependent { return false; } - String[] ID_COMMANDS = { "/usr/bin/id", "/bin/id", "id", "/usr/xpg4/bin/id"}; + String[] ID_COMMANDS = { "/usr/bin/id", "/bin/id", "/usr/xpg4/bin/id", "id"}; Pattern UID_PATTERN = Pattern.compile("^(?:0|[1-9][0-9]*)$"); for (String idCmd: ID_COMMANDS) { Process p = null; diff --git a/transport/src/main/java/io/netty/channel/AbstractChannel.java b/transport/src/main/java/io/netty/channel/AbstractChannel.java index 4aab8260f9..38e7030080 100644 --- a/transport/src/main/java/io/netty/channel/AbstractChannel.java +++ b/transport/src/main/java/io/netty/channel/AbstractChannel.java @@ -467,10 +467,10 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha } // See: https://github.com/netty/netty/issues/576 - if (!PlatformDependent.isWindows() && !PlatformDependent.isRoot() && - Boolean.TRUE.equals(config().getOption(ChannelOption.SO_BROADCAST)) && + if (Boolean.TRUE.equals(config().getOption(ChannelOption.SO_BROADCAST)) && localAddress instanceof InetSocketAddress && - !((InetSocketAddress) localAddress).getAddress().isAnyLocalAddress()) { + !((InetSocketAddress) localAddress).getAddress().isAnyLocalAddress() && + !PlatformDependent.isWindows() && !PlatformDependent.isRoot()) { // Warn a user about the fact that a non-root user can't receive a // broadcast packet on *nix if the socket is bound on non-wildcard address. logger.warn( diff --git a/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java index 930b2ad067..b6616fbd6f 100644 --- a/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/socket/DefaultDatagramChannelConfig.java @@ -157,8 +157,8 @@ public class DefaultDatagramChannelConfig extends DefaultChannelConfig implement try { // See: https://github.com/netty/netty/issues/576 if (broadcast && - !PlatformDependent.isWindows() && !PlatformDependent.isRoot() && - !javaSocket.getLocalAddress().isAnyLocalAddress()) { + !javaSocket.getLocalAddress().isAnyLocalAddress() && + !PlatformDependent.isWindows() && !PlatformDependent.isRoot()) { // Warn a user about the fact that a non-root user can't receive a // broadcast packet on *nix if the socket is bound on non-wildcard address. logger.warn(