Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diameter .dia not automatically inheriting indirect inherits #8235

Open
pespin opened this issue Mar 7, 2024 · 1 comment
Open

Diameter .dia not automatically inheriting indirect inherits #8235

pespin opened this issue Mar 7, 2024 · 1 comment
Assignees
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS

Comments

@pespin
Copy link

pespin commented Mar 7, 2024

Describe the bug

TS 29.273 SAR contains MIP6-Agent-Info AVP from RFC5447, which in turn contains MIP-Home-Agent-Address AVP from RFC 4004.

In summary, specs A, B, C, where C depends on B, and B depends on A.

  • Create a "diameter_3gpp_ts29_273_swx.dia" file containing SAR message definition and which inherits ("@inherits diameter_rfc5447", diameter_rfc5447.dia) to reference "MIP6-Agent-Info".
  • Create a "diameter_rfc5447.dia" file containing MIP6-Agent-Info definition and which inherits ("@inherits diameter_rfc4004", diameter_rfc4004.dia) to reference "MIP-Home-Agent-Address".
  • Create a "diameter_rfc4004.dia" file containing MIP-Home-Agent-Address definition.

Hence, diameter_3gpp_ts29_273_swx.dia is not directly inheriting RFC4004: no "@inherits diameter_rfc4004" in diameter_3gpp_ts29_273_swx.dia.

Then create some code which generates a SAR message containing MIP6-Agent-Info which in turn contains a MIP-Home-Agent-Address, and transmits it with diameter:call().
The diameter app will compile just fine, but it will fail to encode it, because the generated diameter_3gpp_ts29_273_swx.erl/hrl file lacks the code to encode MIP-Home-Agent-Address :
[error] <0.164.0>@aaa_diameter_swx:handle_call:{175,13} Error: encode

If one adds the explicit "@inherits diameter_rfc4004" in diameter_3gpp_ts29_273_swx.dia, then one can see that extra code is generated in diameter_3gpp_ts29_273_swx.erl/hrl and encoding works fine.

So, right now, one must inherit explicitly all indirect dependency .dia files in order to get a working encoder/decoder.

To Reproduce

The steps mentioned above can be seen in this branch "pespin/diameter-bug" I created in osmo-epdg.git:
https://gitea.osmocom.org/erlang/osmo-epdg/commits/branch/pespin/diameter-bug
One can see 3 commits in that branch:

By looking at the last commit one can see code which imho should have already been there already before inheriting the indirect spec.

Expected behavior

I see 2 solutions to the problem:

  • Support automatically inheriting indirect dependencies. If there's spec "A, B and C; C inherits B; B inherits A", then when C inherits B, it should recursively generate code from A too.
  • Not support automatically inheriting indirect dependencies, but at least fail at compile time saying there's a missing inherit/type, since clearly the generated code will fail at runtime.

Affected versions

I'm seeing this with erlang OTP 26.2.2-1 package from Archlinux.

Additional context

@pespin pespin added the bug Issue is reported as a bug label Mar 7, 2024
@IngelaAndin IngelaAndin added the team:PS Assigned to OTP team PS label Mar 8, 2024
@bmk
Copy link
Contributor

bmk commented Apr 11, 2024

We are looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug priority:medium team:PS Assigned to OTP team PS
Projects
None yet
Development

No branches or pull requests

3 participants