amalsaidov opened a new pull request, #11674:
URL: https://github.com/apache/rocketmq/pull/11674

   ### Which Issue(s) This PR Fixes
   
   Fixes #11673
   
   ### Brief Description
   
   `IPAddressUtils#isIPInRange` compared a single-IP ACL entry with the client 
IP as plain strings, so `::1` never matched a client reported as 
`0:0:0:0:0:0:0:1` or `[0:0:0:0:0:0:0:1]` (the `InetSocketAddress#toString()` 
form on JDK 14+).
   
   When the strings differ, the method now compares the parsed addresses, 
provided both sides are valid IP literals (one pair of `[]` around the client 
IP is stripped first). Non-IP values are never resolved and still return 
`false`, so behaviour for IPv4 and invalid input is unchanged.
   
   ### How Did You Test This Change?
   
   Added `IPAddressUtilsTest#isIPInRangeShouldMatchEquivalentIPv6Literals` 
covering compressed, full, bracketed and upper-case forms, plus negative cases 
(different address, non-IP string, different IPv4). It fails before the change 
and passes after; `mvn -pl common -Dtest=IPAddressUtilsTest test` is green.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to