aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-02-12 19:49:36 +0100
committerHarald Welte <laforge@gnumonks.org>2019-02-12 20:29:50 +0100
commit3933e930c3b8de26ab9feb82c1fb50b8dbfabded (patch)
tree91eb389e08f73bc22ab5a546ff20f553f87256a8
parent906357c5e2292d776968af4e364ee1e657d2c117 (diff)
OML: Work around OsmoBSC sending "GET ATTRIBUTES" with short length
OsmoBSC used to have a bug in encoding the "GET ATTRIBUTES" OML message, resulting in the actual message length being three bytes longer than the encoded length value. As in Ib98f0d7c2cff9172714ed18667c02564540d65d7 we have introduced proper consistency checks on length values, all "GET ATTRIBUTES" from OsmoBSC version suntil today will fail. This patch introduces a work-around to remain compatible with old OsmoBSC while still keeping the consistency checks for all other messages. Change-Id: Ifa24e9e2c71feb2c597557807d675438c2825b2d Related: OS#3799
-rw-r--r--src/common/oml.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index 8bc31f85..e544b571 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1102,10 +1102,17 @@ static int down_fom(struct gsm_bts *bts, struct msgb *msg)
}
if (msgb_l3len(msg) > oh->length) {
- LOGP(DOML, LOGL_NOTICE, "OML message with %u extraneous bytes at end: %s\n",
- msgb_l3len(msg) - oh->length, msgb_hexdump(msg));
- /* remove extra bytes at end */
- msgb_l3trim(msg, oh->length);
+ if (oh->mdisc == ABIS_OM_MDISC_FOM && oh->data[0] == NM_MT_GET_ATTR &&
+ msgb_l3len(msg) == oh->length + 3) {
+ /* work-around a bug present in OsmoBSC before February 2019 */
+ DEBUGP(DOML, "GET ATTR with off-by-3 length: Fixing up for OS#3799\n");
+ oh->length += 3;
+ } else {
+ LOGP(DOML, LOGL_NOTICE, "OML message with %u extraneous bytes at end: %s\n",
+ msgb_l3len(msg) - oh->length, msgb_hexdump(msg));
+ /* remove extra bytes at end */
+ msgb_l3trim(msg, oh->length);
+ }
}
if (report_bts_number_incorrect(bts, foh, true))