diameter: default port and transport for DiameterURI #9321
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR consists of two commits;
This fixes the crash when decoding a DiameterURI without a port number. The crash always happens if an Diameter answer with an AVP of type DiameterURI without port number is decoded, since the
rfc
option cannot be specified when handling an answer.When
rfc
is missing in the option, the transport part of thediameter_uri
becomes an empty atom (''), which causes the diameter module to fail to re-encode the decoded AVP (because it won't matchdiameter_types:'DiameterURI'/3
properly).This sets
tcp
as the default transport as described in RFC6733 instead of leaving it empty.Some notes/thoughts;
portnr(<<>>, aaa, #{rfc := 6733})
,transport(<<>>, #{rfc := 6733})
) can be removed if it's preferable.rfc => 6733
fromdiameter_codec_test:opts
. I have no idea how to add a case for this.rfc => 6733
in the decode option by default is another way to solve this, but it may require wider consideration.Please advise 🙂
Debug log w/ redbug: