aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_traffic.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2015-05-06 10:46:22 +0200
committerErlang/OTP <[email protected]>2015-05-06 10:46:22 +0200
commit1055bc6af4599c1c21465929728755ee633b9b26 (patch)
tree990165c3a9a38a198b1cefd63ab2940245cae384 /lib/diameter/src/base/diameter_traffic.erl
parentaf34e2b17e17928ed6af3c963a83b76411525e64 (diff)
parent7d077a6b95a8993d760a03ca59511a93c1d37374 (diff)
downloadotp-1055bc6af4599c1c21465929728755ee633b9b26.tar.gz
otp-1055bc6af4599c1c21465929728755ee633b9b26.tar.bz2
otp-1055bc6af4599c1c21465929728755ee633b9b26.zip
Merge branch 'anders/diameter/counters/OTP-12701' into maint-17
* anders/diameter/counters/OTP-12701: Add counters testcase to 3xxx suite Fix counting error with unknown application id Add missing doc wording
Diffstat (limited to 'lib/diameter/src/base/diameter_traffic.erl')
-rw-r--r--lib/diameter/src/base/diameter_traffic.erl18
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl
index 9a9f7a3197..ffd2c0afa2 100644
--- a/lib/diameter/src/base/diameter_traffic.erl
+++ b/lib/diameter/src/base/diameter_traffic.erl
@@ -1106,19 +1106,15 @@ msg_id(#diameter_packet{header = H}, Dict) ->
%% there are 2^32 (application ids) * 2^24 (command codes) = 2^56
%% pairs for an attacker to choose from.
msg_id(Hdr, Dict) ->
- {_ApplId, Code, R} = Id = diameter_codec:msg_id(Hdr),
- case Dict:msg_name(Code, 0 == R) of
- '' ->
- unknown(Dict:id(), R);
- _ ->
- Id
+ {Aid, Code, R} = Id = diameter_codec:msg_id(Hdr),
+ if Aid == ?APP_ID_RELAY ->
+ {relay, R};
+ true ->
+ choose(Aid /= Dict:id() orelse '' == Dict:msg_name(Code, 0 == R),
+ unknown,
+ Id)
end.
-unknown(?APP_ID_RELAY, R) ->
- {relay, R};
-unknown(_, _) ->
- unknown.
-
%% No E-bit: can't be 3xxx.
is_result(RC, false, _Dict0) ->
RC < 3000 orelse 4000 =< RC;