From f60bc6ad8852e7d97d509ced084c137f55bd4aad Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Fri, 10 Jul 2015 16:36:57 +0200 Subject: Match allowable peer addresses case insensitively Both diameter_tcp and diameter_sctp can be configured with one or more IP addresses from which connections should be accepted (an 'accept' tuple), specified either as a tuple-valued address or as a regular expression. In the latter case, peer addresses are mapped to string using inet:ntoa/1 and the result matched against the regexp. Since (ipv6) addresses are case insensitive, this should also be the case with the match, but was not. --- lib/diameter/src/base/diameter_peer.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diameter/src/base/diameter_peer.erl b/lib/diameter/src/base/diameter_peer.erl index 95c0c65029..96b6d404e0 100644 --- a/lib/diameter/src/base/diameter_peer.erl +++ b/lib/diameter/src/base/diameter_peer.erl @@ -201,7 +201,7 @@ match1(Addr, Match) -> match(Addr, {ok, A}, _) -> Addr == A; match(Addr, {error, _}, RE) -> - match == re:run(inet:ntoa(Addr), RE, [{capture, none}]). + match == re:run(inet:ntoa(Addr), RE, [{capture, none}, caseless]). addr([_|_] = A) -> inet:parse_address(A); -- cgit v1.2.3