fiorix / go-diameter

Diameter stack and Base Protocol (RFC 6733) for the Go programming language
Other
244 stars 141 forks source link

unmarshal issue when two avp's with same id but different VendorId used #169

Open snbuch opened 2 years ago

snbuch commented 2 years ago

It seems the code does not support the case when the same message has two AVPs that have the same avp-id but different VendorIds. I have run into this with the User-Password and 3GPP-Charging-Id used in AAR message - both of these have the avp-id of 2 but the vendorId is different.

It seems Marshal seems to include the VendorId into the message but unmarshal ignores the VendorId so the data of User-Password gets copied into both the avps.

I did find a comment like this: // Relies on the fact that in the same app will not be AVPs with same code but different vendorId

but not sure how it is ok to make such an assumption and why is it necessary. Is it NOT possible to support this case or was it a temporary shortcut? Would it be possible to fix this issue?