diff --git a/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java b/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java index c4847239a2ee4290fcb93ecd47b8fcb9f4b714a1..77abe0e80fbe734576e1b557a889f0e0a2afae47 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/common/AclUtils.java @@ -94,7 +94,7 @@ public class AclUtils { } } - public static String v6ipProcess(String netaddress, String[] strArray, int index) { + public static String v6ipProcess(String netaddress) { int part; String subAddress; boolean isAsterisk = isAsterisk(netaddress); diff --git a/acl/src/main/java/org/apache/rocketmq/acl/plain/RemoteAddressStrategyFactory.java b/acl/src/main/java/org/apache/rocketmq/acl/plain/RemoteAddressStrategyFactory.java index 242c98d6af29dd7d065e511bdd7332af935ee020..8db0fda990a53cb9deadb1db938fdcc61a38e7ca 100644 --- a/acl/src/main/java/org/apache/rocketmq/acl/plain/RemoteAddressStrategyFactory.java +++ b/acl/src/main/java/org/apache/rocketmq/acl/plain/RemoteAddressStrategyFactory.java @@ -153,7 +153,7 @@ public class RemoteAddressStrategyFactory { for (int i = 1; i < strArray.length; i++) { if (ipv6Analysis(strArray, i)) { AclUtils.verify(remoteAddr, index - 1); - String preAddress = AclUtils.v6ipProcess(remoteAddr, strArray, index); + String preAddress = AclUtils.v6ipProcess(remoteAddr); this.index = StringUtils.split(preAddress, ":").length; this.head = preAddress; break; diff --git a/acl/src/test/java/org/apache/rocketmq/acl/common/AclUtilsTest.java b/acl/src/test/java/org/apache/rocketmq/acl/common/AclUtilsTest.java index d1fdcb66d4384c084513ef72f8ed70b864a2cfa1..7df0afa6393346eccfc4f8bc48e1952d8f746ede 100644 --- a/acl/src/test/java/org/apache/rocketmq/acl/common/AclUtilsTest.java +++ b/acl/src/test/java/org/apache/rocketmq/acl/common/AclUtilsTest.java @@ -181,19 +181,23 @@ public class AclUtilsTest { public void v6ipProcessTest() { String remoteAddr = "5::7:6:1-200:*"; String[] strArray = StringUtils.split(remoteAddr, ":"); - Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0000:0000:0000:0007:0006"); + Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr), "0005:0000:0000:0000:0007:0006"); +// Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0000:0000:0000:0007:0006"); remoteAddr = "5::7:6:1-200"; strArray = StringUtils.split(remoteAddr, ":"); - Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0000:0000:0000:0000:0007:0006"); + Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr), "0005:0000:0000:0000:0000:0007:0006"); +// Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0000:0000:0000:0000:0007:0006"); remoteAddr = "5::7:6:*"; strArray = StringUtils.split(remoteAddr, ":"); - Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0000:0000:0000:0000:0007:0006"); + Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr), "0005:0000:0000:0000:0000:0007:0006"); +// Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0000:0000:0000:0000:0007:0006"); remoteAddr = "5:7:6:*"; strArray = StringUtils.split(remoteAddr, ":"); - Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0007:0006"); + Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr), "0005:0007:0006"); +// Assert.assertEquals(AclUtils.v6ipProcess(remoteAddr, strArray, 3), "0005:0007:0006"); } @Test