summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorUlf Wiger <ulf@feuerlabs.com>2015-12-22 14:43:27 -0800
committerUlf Wiger <ulf@feuerlabs.com>2016-01-12 08:18:17 -0800
commit7922125aba23033945e3b55a4bf78ef8e84521d0 (patch)
tree2d9d41249aa12072aeebe15ad08148185b7da5a2 /components
parentd69fcf58db0daa09fcf6ac826c139e35711cecd0 (diff)
downloadrvi_core-7922125aba23033945e3b55a4bf78ef8e84521d0.tar.gz
selects wrong remote addr
Diffstat (limited to 'components')
-rw-r--r--components/authorize/src/authorize_keys.erl3
-rw-r--r--components/dlink_tcp/src/dlink_tcp_rpc.erl2
2 files changed, 3 insertions, 2 deletions
diff --git a/components/authorize/src/authorize_keys.erl b/components/authorize/src/authorize_keys.erl
index 31dc1ca..593f69c 100644
--- a/components/authorize/src/authorize_keys.erl
+++ b/components/authorize/src/authorize_keys.erl
@@ -273,7 +273,8 @@ to_bin(B) when is_binary(B) -> B;
to_bin(L) when is_list(L) -> iolist_to_binary(L);
to_bin(I) when is_integer(I) -> integer_to_binary(I).
-filter_by_service_(Services, Conn) ->
+filter_by_service_(Services, Conn0) ->
+ Conn = normalize_conn(Conn0),
?debug("Filter: creds = ~p", [[{K,abbrev_payload(V)} || {K,V} <- ets:tab2list(?CREDS)]]),
Invoke = ets:select(?CREDS, [{ {{Conn,'_'}, #cred{right_to_invoke = '$1',
_ = '_'}},
diff --git a/components/dlink_tcp/src/dlink_tcp_rpc.erl b/components/dlink_tcp/src/dlink_tcp_rpc.erl
index fc907d6..330985a 100644
--- a/components/dlink_tcp/src/dlink_tcp_rpc.erl
+++ b/components/dlink_tcp/src/dlink_tcp_rpc.erl
@@ -667,7 +667,7 @@ process_authorize(FromPid, PeerIP, PeerPort, RemoteAddress,
?debug("dlink_tcp:authorize(): Credentials: ~p", [ [authorize_keys:abbrev_bin(C) || C <- Credentials] ]),
{NRemoteAddress, NRemotePort} = Conn =
case { RemoteAddress, RemotePort } of
- { "0.0.0.0", 0 } ->
+ { <<"0.0.0.0">>, 0 } ->
?info("dlink_tcp:authorize(): Remote is behind firewall. Will use ~p:~p",
[ PeerIP, PeerPort]),