Harald Welte has submitted this change and it was merged.

Change subject: OML: use fom_hdr while handling attr. request
......................................................................


OML: use fom_hdr while handling attr. request

Use Obj. Class and TRX# from abis_om_fom_hdr of incoming request instead
of BTS' MO to properly distinguish between BTS-level and TRX-level
attributes.

Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852
Related: OS#2317
---
M src/common/oml.c
1 file changed, 9 insertions(+), 7 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/oml.c b/src/common/oml.c
index 8f23f82..20f45e5 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -257,27 +257,29 @@
 }
 
 /* send 3GPP TS 52.021 §8.11.2 Get Attribute Response */
-static int oml_tx_attr_resp(const struct gsm_bts *bts, struct gsm_abis_mo *mo, 
const uint8_t *attr, uint16_t attr_len)
+static int oml_tx_attr_resp(struct gsm_bts *bts, const struct abis_om_fom_hdr 
*foh, const uint8_t *attr,
+                           uint16_t attr_len)
 {
        struct msgb *nmsg = oml_msgb_alloc();
        uint8_t resp[MAX_VERSION_LENGTH * attr_len * 2]; /* heuristic for 
Attribute Response Info space requirements */
        int len;
 
-       LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n", 
gsm_abis_mo_name(mo));
+       LOGP(DOML, LOGL_INFO, "%s Tx Get Attribute Response\n",
+            get_value_string(abis_nm_obj_class_names, foh->obj_class));
 
        if (!nmsg)
                return -ENOMEM;
 
-       switch (mo->obj_class) {
+       switch (foh->obj_class) {
        case NM_OC_BTS:
                len = handle_attrs_bts(resp, bts, attr, attr_len);
                break;
        case NM_OC_BASEB_TRANSC:
-               len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, 
mo->obj_inst.trx_nr), attr, attr_len);
+               len = handle_attrs_trx(resp, gsm_bts_trx_num(bts, 
foh->obj_inst.trx_nr), attr, attr_len);
                break;
        default:
                LOGP(DOML, LOGL_ERROR, "Unsupported MO class %s in Get 
Attribute Response\n",
-                    get_value_string(abis_nm_obj_class_names, mo->obj_class));
+                    get_value_string(abis_nm_obj_class_names, foh->obj_class));
                len = -EINVAL;
        }
 
@@ -290,7 +292,7 @@
        /* §9.4.64 Get Attribute Response Info */
        msgb_tl16v_put(nmsg, NM_ATT_GET_ARI, len, resp);
 
-       return oml_mo_send_msg(mo, nmsg, NM_MT_GET_ATTR_RESP);
+       return oml_mo_send_msg(&bts->mo, nmsg, NM_MT_GET_ATTR_RESP);
 }
 
 /* 8.8.1 sending State Changed Event Report */
@@ -540,7 +542,7 @@
                return oml_fom_ack_nack(msg, NM_NACK_INCORR_STRUCT);
        }
 
-       rc = oml_tx_attr_resp(bts, &bts->mo, TLVP_VAL(&tp, 
NM_ATT_LIST_REQ_ATTR), TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR));
+       rc = oml_tx_attr_resp(bts, foh, TLVP_VAL(&tp, NM_ATT_LIST_REQ_ATTR), 
TLVP_LEN(&tp, NM_ATT_LIST_REQ_ATTR));
        if (rc < 0) {
                LOGP(DOML, LOGL_ERROR, "Failed to respond to O&M Get Attributes 
message: %s\n", strerror(-rc));
                switch (-rc) {

-- 
To view, visit https://gerrit.osmocom.org/3090
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <[email protected]>

Reply via email to