pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/41776?usp=email )

Change subject: abis_osmo: Fix reading Abis IPA OSMO_EXT type
......................................................................

abis_osmo: Fix reading Abis IPA OSMO_EXT type

The l2 buffer points to the IPA payload, not the the ext type.
This was probably not the case during initial development of the stack,
but it is since a while ago, to be inline with usual behavior of ipa
handling.

This patch fixes BTS_Tests_OML.TC_ipa_osmo_pcu_anr_fwd failure.

Change-Id: I4941d28b2416a70e61d2881e8ebc556c5421256c
---
M src/common/abis_osmo.c
1 file changed, 2 insertions(+), 14 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified
  daniel: Looks good to me, but someone else must approve




diff --git a/src/common/abis_osmo.c b/src/common/abis_osmo.c
index beb9992..eb764d5 100644
--- a/src/common/abis_osmo.c
+++ b/src/common/abis_osmo.c
@@ -111,24 +111,12 @@
 /* incoming IPA/OSMO extension Abis message from BSC */
 int down_osmo(struct gsm_bts *bts, struct msgb *msg)
 {
-       uint8_t *type;
-
-       if (msgb_l2len(msg) < 1) {
-               oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, 
OSMO_EVT_MAJ_UKWN_MSG,
-                                        "OSMO message too short\n");
-               msgb_free(msg);
-               return -EIO;
-       }
-
-       type = msgb_l2(msg);
-       msg->l2h = type + 1;
-
-       switch (*type) {
+       switch (osmo_ipa_msgb_cb_proto_ext(msg)) {
        case IPAC_PROTO_EXT_PCU:
                return rx_down_osmo_pcu(bts, msg);
        default:
                oml_tx_failure_event_rep(&bts->mo, NM_SEVER_MAJOR, 
OSMO_EVT_MAJ_UKWN_MSG,
-                                        "OSMO message unknown extension %u\n", 
*type);
+                                        "OSMO message unknown extension %u\n", 
osmo_ipa_msgb_cb_proto_ext(msg));
                msgb_free(msg);
                return -EIO;
        }

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/41776?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I4941d28b2416a70e61d2881e8ebc556c5421256c
Gerrit-Change-Number: 41776
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to