From a85d5ae40463ac5157ce4c386c37d30505488466 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Sat, 2 Sep 2017 16:17:38 +0200 Subject: 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. --- lib/diameter/src/base/diameter_gen.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') 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 %% -- cgit v1.2.3