diff options
author | Anders Svensson <[email protected]> | 2013-06-02 14:59:19 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-06-02 14:59:19 +0200 |
commit | e87ef4db28bdb32299682a05314996e34cb5fe25 (patch) | |
tree | 1a3a84125eea412e3aea256e410007a7ec01f201 /lib/diameter/src | |
parent | aae68673a30f9c7e0fffb424edd6abab6a70c1b9 (diff) | |
parent | f3e38ea0653614bcfd3a03846d4cea3df5da3cdf (diff) | |
download | otp-e87ef4db28bdb32299682a05314996e34cb5fe25.tar.gz otp-e87ef4db28bdb32299682a05314996e34cb5fe25.tar.bz2 otp-e87ef4db28bdb32299682a05314996e34cb5fe25.zip |
Merge branch 'anders/diameter/host_ip_address/OTP-11045' into maint
* anders/diameter/host_ip_address/OTP-11045:
Respect Host-IP-Address configuration
Diffstat (limited to 'lib/diameter/src')
-rw-r--r-- | lib/diameter/src/base/diameter_peer_fsm.erl | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl index d9db630ec0..65645e4dff 100644 --- a/lib/diameter/src/base/diameter_peer_fsm.erl +++ b/lib/diameter/src/base/diameter_peer_fsm.erl @@ -233,20 +233,21 @@ start_transport(Addrs0, T) -> {TPid, Addrs, Tmo, Data} -> erlang:monitor(process, TPid), q_next(TPid, Addrs0, Tmo, Data), - {TPid, addrs(Addrs, Addrs0)}; + {TPid, Addrs}; No -> exit({shutdown, No}) end. -addrs([], Addrs0) -> - Addrs0; -addrs(Addrs, _) -> - Addrs. - -svc(Svc, []) -> - Svc; -svc(Svc, Addrs) -> - readdr(Svc, Addrs). +svc(#diameter_service{capabilities = LCaps0} = Svc, Addrs) -> + #diameter_caps{host_ip_address = Addrs0} + = LCaps0, + case Addrs0 of + [] -> + LCaps = LCaps0#diameter_caps{host_ip_address = Addrs}, + Svc#diameter_service{capabilities = LCaps}; + [_|_] -> + Svc + end. readdr(#diameter_service{capabilities = LCaps0} = Svc, Addrs) -> LCaps = LCaps0#diameter_caps{host_ip_address = Addrs}, @@ -360,7 +361,7 @@ transition({diameter, {TPid, connected, Remote, LAddrs}}, service = Svc} = S) -> transition({diameter, {TPid, connected, Remote}}, - S#state{service = readdr(Svc, LAddrs)}); + S#state{service = svc(Svc, LAddrs)}); %% Connection from peer. transition({diameter, {TPid, connected}}, |