diff options
author | Anders Svensson <[email protected]> | 2015-03-27 17:02:26 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2015-03-27 17:02:26 +0100 |
commit | 45f33f09d56af793a2142ab402d73868be30b223 (patch) | |
tree | 7ca20b645e56555f498c18e44ab3b8ea8a1f73a4 /lib/diameter/src/base/diameter_config.erl | |
parent | cbceea683c9f718bc6f0140c2402a7f74455ea14 (diff) | |
parent | 39acfdb005626ae1bf2f68808f9e8116637c7121 (diff) | |
download | otp-45f33f09d56af793a2142ab402d73868be30b223.tar.gz otp-45f33f09d56af793a2142ab402d73868be30b223.tar.bz2 otp-45f33f09d56af793a2142ab402d73868be30b223.zip |
Merge branch 'anders/diameter/hardening/OTP-12628' into maint
* anders/diameter/hardening/OTP-12628:
Remove potentially large error reason in call to diameter_lib:log/4
Limit FQDN in DiameterURI to 255 octets
Limit DiameterURI ports to 0-65535 digits on decode
Add service_opt() incoming_maxlen
Add guard to reject {spawn_opt, false} as transport/service_opt()
Diffstat (limited to 'lib/diameter/src/base/diameter_config.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_config.erl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl index 0d0304bf33..8ac3b9d6ca 100644 --- a/lib/diameter/src/base/diameter_config.erl +++ b/lib/diameter/src/base/diameter_config.erl @@ -159,7 +159,8 @@ stop_service(SvcName) -> %% # add_transport/2 %% -------------------------------------------------------------------------- --spec add_transport(diameter:service_name(), {connect|listen, [diameter:transport_opt()]}) +-spec add_transport(diameter:service_name(), + {connect|listen, [diameter:transport_opt()]}) -> {ok, diameter:transport_ref()} | {error, term()}. @@ -645,6 +646,7 @@ make_config(SvcName, Opts) -> {false, monitor}, {?NOMASK, sequence}, {nodes, restrict_connections}, + {16#FFFFFF, incoming_maxlen}, {true, string_decode}, {[], spawn_opt}]), @@ -670,12 +672,20 @@ make_opts(Opts, Defs) -> [{K, opt(K,V)} || {K,V} <- Known]. +opt(incoming_maxlen, N) + when 0 =< N, N < 1 bsl 24 -> + N; + opt(spawn_opt, L) when is_list(L) -> L; opt(K, false = B) - when K /= sequence -> + when K == share_peers; + K == use_shared_peers; + K == monitor; + K == restrict_connections; + K == string_decode -> B; opt(K, true = B) |