dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bts/+/36018?usp=email )


Change subject: pcu_sock: forward PCU_VERSION only once
......................................................................

pcu_sock: forward PCU_VERSION only once

The PCU may send its version at different occasions and in case the BTS
is not active the PCU even sends the version number in regular
intervals. When the BTS a receives a PCU_VERSION txt message from the PCU,
it forwards it as an OML Failure Event Report. This means we might get
multiple copies of the same message on OML. This should be avoided, we
only should forward the PCU_VERSION when it actually changes.

Related: OS#6270
Change-Id: Id82fe0504d0cbdf71473c1e7dfe6125a3471bd85
---
M include/osmo-bts/bts.h
M src/common/abis.c
M src/common/pcu_sock.c
3 files changed, 28 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/36018/1

diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index c3e5dce..7193a30 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -173,6 +173,7 @@

        /* Connected PCU version (if any) */
        char pcu_version[MAX_VERSION_LENGTH];
+       bool pcu_version_oml_sent;

        /* maximum Tx power that the MS is permitted to use in this cell */
        int ms_max_power;
diff --git a/src/common/abis.c b/src/common/abis.c
index 5629cf2..e6a11ba 100644
--- a/src/common/abis.c
+++ b/src/common/abis.c
@@ -110,6 +110,7 @@
                bts->osmo_link = NULL;
        }

+       bts->pcu_version_oml_sent = false;
 }

 static int pick_next_bsc(struct osmo_fsm_inst *fi)
diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c
index 048e766..b8c68d4 100644
--- a/src/common/pcu_sock.c
+++ b/src/common/pcu_sock.c
@@ -864,7 +864,15 @@
        case PCU_VERSION:
                LOGP(DPCU, LOGL_INFO, "OsmoPCU version %s connected\n",
                     txt->text);
-               oml_tx_failure_event_rep(&bts->gprs.cell.mo, NM_SEVER_CEASED, 
OSMO_EVT_PCU_VERS, txt->text);
+
+               /* Forward the PCU version information only once */
+               if (strcmp(bts->pcu_version, txt->text) != 0)
+                       bts->pcu_version_oml_sent = false;
+               if (!bts->pcu_version_oml_sent && bts->oml_link) {
+                       oml_tx_failure_event_rep(&bts->gprs.cell.mo, 
NM_SEVER_CEASED, OSMO_EVT_PCU_VERS, txt->text);
+                       bts->pcu_version_oml_sent = true;
+               }
+
                osmo_strlcpy(bts->pcu_version, txt->text, MAX_VERSION_LENGTH);

                /* patch SI to advertise GPRS, *if* the SI sent by BSC said so 
*/

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id82fe0504d0cbdf71473c1e7dfe6125a3471bd85
Gerrit-Change-Number: 36018
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to