aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2017-09-02 16:17:38 +0200
committerAnders Svensson <[email protected]>2017-09-04 11:43:12 +0200
commita85d5ae40463ac5157ce4c386c37d30505488466 (patch)
treebc834389595dcad3d967678798dbea8e7eeedfa7 /lib
parentab20efcfec9b9ba72a734c235510aca4d37a10fd (diff)
downloadotp-a85d5ae40463ac5157ce4c386c37d30505488466.tar.gz
otp-a85d5ae40463ac5157ce4c386c37d30505488466.tar.bz2
otp-a85d5ae40463ac5157ce4c386c37d30505488466.zip
Fix decode undef
Function avp/5 isn't exported from dictionary modules. Not necessarily intentional, but don't just export it since that requires recompilation of all dictionary modules, since the function is in diameter_gen.hrl. Not having to recompile was the main motivation for moving most of the included code to module diameter_gen in commit 205521d3. This reveals a weakness in the decode of answers setting the E-bit: any AVP that isn't defined by the common application won't be decoded; the diameter_avp records that these are packed into (in the 'AVP' field of a message record, or equivalent) will have value = undefined. This is nothing new (same in OTP 19), but the values should be decoded. Fix it (and the lack of test coverage) in a subsequent commit that will add avp_dictionaries config.
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/src/base/diameter_gen.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/diameter/src/base/diameter_gen.erl b/lib/diameter/src/base/diameter_gen.erl
index 0aea982a54..307c3b4254 100644
--- a/lib/diameter/src/base/diameter_gen.erl
+++ b/lib/diameter/src/base/diameter_gen.erl
@@ -572,7 +572,7 @@ avp_decode(Data, AvpName, Opts, Mod, Mod) ->
Mod:avp(decode, Data, AvpName, Opts);
avp_decode(Data, AvpName, Opts, Mod, _) ->
- Mod:avp(decode, Data, AvpName, Opts, Mod).
+ Mod:avp(decode, Data, AvpName, Opts#{module := Mod}).
%% set_strict/3
%%