diff options
author | Anders Svensson <[email protected]> | 2017-08-29 15:13:55 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-08-29 15:13:55 +0200 |
commit | e3c1163d2d42529604a2c0047d22a837d959d780 (patch) | |
tree | 3f75bf752b1e4d49af76fae347e094ec3ca53b5d | |
parent | c98204a6dacbade814fa32bb1792d05d0657d8db (diff) | |
parent | 3c7e35ca4512088f0b4074f809f3110dfa285b8e (diff) | |
download | otp-e3c1163d2d42529604a2c0047d22a837d959d780.tar.gz otp-e3c1163d2d42529604a2c0047d22a837d959d780.tar.bz2 otp-e3c1163d2d42529604a2c0047d22a837d959d780.zip |
Merge branch 'anders/diameter/strict_capx/OTP-14546' into maint
* anders/diameter/strict_capx/OTP-14546:
Document transport_opt() strict_capx
Rename transport_opt() capx_strictness to strict_capx
-rw-r--r-- | lib/diameter/doc/src/diameter.xml | 14 | ||||
-rw-r--r-- | lib/diameter/src/base/diameter.erl | 2 | ||||
-rw-r--r-- | lib/diameter/src/base/diameter_config.erl | 2 | ||||
-rw-r--r-- | lib/diameter/src/base/diameter_peer_fsm.erl | 4 |
4 files changed, 19 insertions, 3 deletions
diff --git a/lib/diameter/doc/src/diameter.xml b/lib/diameter/doc/src/diameter.xml index ad82cafd2f..8b72736108 100644 --- a/lib/diameter/doc/src/diameter.xml +++ b/lib/diameter/doc/src/diameter.xml @@ -1411,6 +1411,20 @@ Defaults to the list configured on the service if not specified.</p> </item> <tag> +<marker id="strict_capx"/><c>{strict_capx, boolean()]}</c></tag> +<item> +<p> +Whether or not to enforce the RFC 6733 requirement that any message +before capabilities exchange should close the peer connection. +If false then unexpected messages are discarded.</p> + +<p> +Defaults to true. +Changing this results in non-standard behaviour, but can be useful in +case peers are known to be behave badly.</p> +</item> + +<tag> <marker id="transport_config"/><c>{transport_config, term()}</c></tag><item/> <tag><c>{transport_config, term(), &dict_Unsigned32; | infinity}</c></tag> <item> diff --git a/lib/diameter/src/base/diameter.erl b/lib/diameter/src/base/diameter.erl index 2e18a1d903..888a108f8b 100644 --- a/lib/diameter/src/base/diameter.erl +++ b/lib/diameter/src/base/diameter.erl @@ -394,7 +394,7 @@ call(SvcName, App, Message) -> | {capabilities, [capability()]} | {capabilities_cb, evaluable()} | {capx_timeout, 'Unsigned32'()} - | {capx_strictness, boolean()} + | {strict_capx, boolean()} | {disconnect_cb, evaluable()} | {dpr_timeout, 'Unsigned32'()} | {dpa_timeout, 'Unsigned32'()} diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl index f1b6e56782..d54dbd9976 100644 --- a/lib/diameter/src/base/diameter_config.erl +++ b/lib/diameter/src/base/diameter_config.erl @@ -591,6 +591,8 @@ opt({K, Tmo}) ?IS_UINT32(Tmo); opt({capx_strictness, B}) -> + is_boolean(B) andalso {value, {strict_capx, B}}; +opt({strict_capx, B}) -> is_boolean(B); opt({length_errors, T}) -> diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl index 1a3438fd22..d99f11a697 100644 --- a/lib/diameter/src/base/diameter_peer_fsm.erl +++ b/lib/diameter/src/base/diameter_peer_fsm.erl @@ -238,7 +238,7 @@ i({Ack, WPid, {M, Ref} = T, Opts, {SvcOpts, Nodes, Dict0, Svc}}) -> proplists:get_value(dpa_timeout, Opts, ?DPA_TIMEOUT)}), Tmo = proplists:get_value(capx_timeout, Opts, ?CAPX_TIMEOUT), - Strictness = proplists:get_value(capx_strictness, Opts, true), + Strict = proplists:get_value(strict_capx, Opts, true), LengthErr = proplists:get_value(length_errors, Opts, exit), {TPid, Addrs} = start_transport(T, Rest, Svc), @@ -252,7 +252,7 @@ i({Ack, WPid, {M, Ref} = T, Opts, {SvcOpts, Nodes, Dict0, Svc}}) -> mode = M, service = svc(Svc, Addrs), length_errors = LengthErr, - strict = Strictness, + strict = Strict, incoming_maxlen = Maxlen, codec = maps:with([decode_format, string_decode, |