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
fix(amf): PDU-Session accept message coming with extra buffer causing failure of PDU-Session #13103
Conversation
Thanks for opening a PR! 💯
Howto
More infoPlease take a moment to read through the Magma project's
If this is your first Magma PR, also consider reading
|
} | ||
|
||
dec_ret = aper_decode( | ||
NULL, &asn_DEF_Ngap_NGAP_PDU, (void**) &pdu, bdata(raw), blength(raw), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<void**>(...) instead [readability/casting] [4]
15f0815
to
6392f24
Compare
ngap_pdusession_setup_item_ies->pDUSessionResourceSetupRequestTransfer.buf = | ||
(uint8_t*)calloc(er.encoded, sizeof(uint8_t)); | ||
(uint8_t*)calloc(((er.encoded + 7) >> 3), sizeof(uint8_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]
|
||
memcpy((void*)ngap_pdusession_setup_item_ies | ||
->pDUSessionResourceSetupRequestTransfer.buf, | ||
(void*)transfer->data, er.encoded); | ||
(void*)transfer->data, blength(transfer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<void*>(...) instead [readability/casting] [4]
6392f24
to
1db1b40
Compare
1db1b40
to
5681bee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
5681bee
to
524a718
Compare
524a718
to
b85f96b
Compare
… failure of PDU-Session Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
b85f96b
to
5055f0c
Compare
session_context->pDUSessionResourceSetupRequestTransfer.buf = | ||
(uint8_t*)calloc(er.encoded, sizeof(uint8_t)); | ||
(uint8_t*)calloc(((er.encoded + 7) >> 3), sizeof(uint8_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]
|
||
memcpy((void*)session_context->pDUSessionResourceSetupRequestTransfer.buf, | ||
(void*)transfer->data, er.encoded); | ||
(void*)transfer->data, blength(transfer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<void*>(...) instead [readability/casting] [4]
5055f0c
to
0619ad6
Compare
bstring transfer = blk2bstr(buffer, er.encoded); | ||
&pduSessionResourceSetupRequestTransferIEs); | ||
uint32_t encoded_bytes = NGAP_ASN_ENCODED_BYTES(er.encoded); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Line ends in whitespace. Consider deleting these extra spaces. [whitespace/end_of_line] [4]
session_context->pDUSessionResourceSetupRequestTransfer.buf = | ||
(uint8_t*)calloc(er.encoded, sizeof(uint8_t)); | ||
(uint8_t*)calloc(encoded_bytes, sizeof(uint8_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]
ngap_pdusession_setup_item_ies->pDUSessionResourceSetupRequestTransfer.buf = | ||
(uint8_t*)calloc(er.encoded, sizeof(uint8_t)); | ||
(uint8_t*)calloc(encoded_bytes, sizeof(uint8_t)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[cpplint] reported by reviewdog 🐶
Using C-style cast. Use reinterpret_cast<uint8_t*>(...) instead [readability/casting] [4]
Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
0619ad6
to
e81ad04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for explanation.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM |
… failure of PDU-Session (magma#13103) * fix(amf): PDU-Session accept message coming with extra buffer causing failure of PDU-Session Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai> * Addressed review comments (R1) Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai> * Addressed review comments (R2) Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai> * Addressed review comments (R3) Signed-off-by: priya-wavelabs <priya.agrawal@wavelabs.ai>
Signed-off-by: priya-wavelabs priya.agrawal@wavelabs.ai
Summary
PDU-Session accept message coming with extra buffer causing failure of PDU-Session . With other gnb simulators we are not seeing this issue.
Test Plan
Verified with unit test:
Basic sanity with ueransim.
Pcap:
MME Log:
mme_july_6.log
Additional Information