aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-06-13 13:18:39 +0200
committerAnders Svensson <[email protected]>2013-06-13 17:08:29 +0200
commitc2d5c74d231b62cc511f3927201ac6578844b578 (patch)
treebcd81cae330cb20e45eed943ae04ac058e4d188e /lib/diameter/src/base
parentfdd8705381fb3accd2c9becea902fe8754bbb0ec (diff)
downloadotp-c2d5c74d231b62cc511f3927201ac6578844b578.tar.gz
otp-c2d5c74d231b62cc511f3927201ac6578844b578.tar.bz2
otp-c2d5c74d231b62cc511f3927201ac6578844b578.zip
Fix list-valued Vendor-Specific-Application-Id config
Commit f0a36c79 broke the handling of such configuration, resulting in a function clause error in diameter_capx if the list was not of length 3, and faulty extraction of application id's otherwise. Only record-valued config was properly interpreted.
Diffstat (limited to 'lib/diameter/src/base')
-rw-r--r--lib/diameter/src/base/diameter_capx.erl9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/diameter/src/base/diameter_capx.erl b/lib/diameter/src/base/diameter_capx.erl
index 4b821f5139..1a931a9854 100644
--- a/lib/diameter/src/base/diameter_capx.erl
+++ b/lib/diameter/src/base/diameter_capx.erl
@@ -419,12 +419,13 @@ app_union(#diameter_caps{auth_application_id = U,
vendor_specific_application_id = V}) ->
set_list(U ++ C ++ lists:flatmap(fun vsa_apps/1, V)).
-vsa_apps([_ | [_,_] = Ids]) ->
- lists:append(Ids);
+vsa_apps(Vals)
+ when is_list(Vals) ->
+ lists:flatmap(fun({'Vendor-Id', _}) -> []; ({_, Ids}) -> Ids end, Vals);
vsa_apps(Rec)
when is_tuple(Rec) ->
- [_|T] = tuple_to_list(Rec),
- vsa_apps(T).
+ [_Name, _VendorId | Idss] = tuple_to_list(Rec),
+ lists:append(Idss).
%% It's a configuration error for a locally advertised application not
%% to be represented in Apps. Don't just match on lists:keyfind/3 in