Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12867 )

Change subject: OML: send proper OML alerts in case of errors
......................................................................

OML: send proper OML alerts in case of errors

Change-Id: I5b19b82a4874617c7c584cf3eac55eb9c756710a
---
M src/common/oml.c
1 file changed, 21 insertions(+), 9 deletions(-)

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



diff --git a/src/common/oml.c b/src/common/oml.c
index 82d12c7..313ff96 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1378,12 +1378,14 @@
        int ret;

        if (msgb_l2len(msg) < sizeof(*foh)) {
-               LOGP(DOML, LOGL_NOTICE, "Manufacturer O&M message too short\n");
+               oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+                                        "Manufacturer O&M message too 
short\n");
                return -EIO;
        }

        if (strncmp((char *)&oh->data[1], abis_nm_ipa_magic, idstrlen)) {
-               LOGP(DOML, LOGL_ERROR, "Manufacturer OML message != ipaccess 
not supported\n");
+               oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+                                        "Manufacturer OML message != ipaccess 
not supported\n");
                return -EINVAL;
        }

@@ -1411,8 +1413,15 @@
                ret = oml_ipa_set_attr(bts, msg);
                break;
        default:
-               LOGP(DOML, LOGL_INFO, "Manufacturer Formatted O&M msg_type 
0x%02x\n",
-                       foh->msg_type);
+               trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+               if (trx) {
+                       oml_tx_failure_event_rep(&trx->mo, 
OSMO_EVT_MAJ_UKWN_MSG,
+                                                "unknown Manufacturer O&M 
msg_type 0x%02x",
+                                                foh->msg_type);
+               } else
+                       oml_tx_failure_event_rep(&bts->mo, 
OSMO_EVT_MAJ_UKWN_MSG,
+                                                "unknown Manufacturer O&M 
msg_type 0x%02x",
+                                                foh->msg_type);
                ret = oml_fom_ack_nack(msg, NM_NACK_MSGTYPE_INVAL);
        }
 
@@ -1426,7 +1435,8 @@
        int ret = 0;

        if (msgb_l2len(msg) < 1) {
-               LOGP(DOML, LOGL_NOTICE, "OML message too short\n");
+               oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+                                        "OML message too short\n");
                msgb_free(msg);
                return -EIO;
        }
@@ -1435,7 +1445,8 @@
        switch (oh->mdisc) {
        case ABIS_OM_MDISC_FOM:
                if (msgb_l2len(msg) < sizeof(*oh)) {
-                       LOGP(DOML, LOGL_NOTICE, "Formatted O&M message too 
short\n");
+                       oml_tx_failure_event_rep(&bts->mo, 
OSMO_EVT_MAJ_UKWN_MSG,
+                                               "Formatted O&M message too 
short\n");
                        ret = -EIO;
                        break;
                }
@@ -1443,15 +1454,16 @@
                break;
        case ABIS_OM_MDISC_MANUF:
                if (msgb_l2len(msg) < sizeof(*oh)) {
-                       LOGP(DOML, LOGL_NOTICE, "Manufacturer O&M message too 
short\n");
+                       oml_tx_failure_event_rep(&bts->mo, 
OSMO_EVT_MAJ_UKWN_MSG,
+                                               "Manufacturer O&M message too 
short\n");
                        ret = -EIO;
                        break;
                }
                ret = down_mom(bts, msg);
                break;
        default:
-               LOGP(DOML, LOGL_NOTICE, "unknown OML msg_discr 0x%02x\n",
-                       oh->mdisc);
+               oml_tx_failure_event_rep(&bts->mo, OSMO_EVT_MAJ_UKWN_MSG,
+                                        "unknown O&M msg_disc 0x%02x\n", 
oh->mdisc);
                ret = -EINVAL;
        }


--
To view, visit https://gerrit.osmocom.org/12867
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I5b19b82a4874617c7c584cf3eac55eb9c756710a
Gerrit-Change-Number: 12867
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-CC: Max <[email protected]>
Gerrit-CC: Pau Espin Pedrol <[email protected]>

Reply via email to