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

 (

1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: Handle empty (idle) PDCH blocks gracefully
......................................................................

Handle empty (idle) PDCH blocks gracefully

An empty PDCH block contains no payload, sysmo-bts and similar BTS
models crash, because they expect the msg->l2h to be set. The function
l1sap_pdch_req() will not set msg->l2h for empty PDCH blocks, so these
models crash.

The current osmo-pcu does not send empty PDCH blocks to these BTS
models. But there shouldn't be a crash, if we receive empty PDCH blocks
over the PCU socket interface.

Change-Id: Icb52c896766425fcf453c65530c4c0b8d06b8821
---
M src/osmo-bts-lc15/l1_if.c
M src/osmo-bts-oc2g/l1_if.c
M src/osmo-bts-octphy/l1_if.c
M src/osmo-bts-sysmo/l1_if.c
4 files changed, 22 insertions(+), 4 deletions(-)

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




diff --git a/src/osmo-bts-lc15/l1_if.c b/src/osmo-bts-lc15/l1_if.c
index bf120a9..0df2c8a 100644
--- a/src/osmo-bts-lc15/l1_if.c
+++ b/src/osmo-bts-lc15/l1_if.c
@@ -347,7 +347,7 @@
                abort();
        }

-       len = msgb_l2len(msg);
+       len = (msg->l2h) ? msgb_l2len(msg) : 0;

        chan_nr = l1sap->u.data.chan_nr;
        link_id = l1sap->u.data.link_id;
diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c
index 2ad59c9..0e45bf6 100644
--- a/src/osmo-bts-oc2g/l1_if.c
+++ b/src/osmo-bts-oc2g/l1_if.c
@@ -392,7 +392,7 @@
                abort();
        }

-       len = msgb_l2len(msg);
+       len = (msg->l2h) ? msgb_l2len(msg) : 0;

        chan_nr = l1sap->u.data.chan_nr;
        link_id = l1sap->u.data.link_id;
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index c79c115..074a1a7 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -479,7 +479,7 @@
                abort();
        }

-       len = msgb_l2len(msg);
+       len = (msg->l2h) ? msgb_l2len(msg) : 0;

        chan_nr = l1sap->u.data.chan_nr;
        link_id = l1sap->u.data.link_id;
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 49a8c5d..1ebece5 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -344,7 +344,7 @@
                abort();
        }

-       len = msgb_l2len(msg);
+       len = (msg->l2h) ? msgb_l2len(msg) : 0;

        chan_nr = l1sap->u.data.chan_nr;
        link_id = l1sap->u.data.link_id;

--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/35270?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: Icb52c896766425fcf453c65530c4c0b8d06b8821
Gerrit-Change-Number: 35270
Gerrit-PatchSet: 2
Gerrit-Owner: jolly <andr...@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanits...@sysmocom.de>
Gerrit-Reviewer: jolly <andr...@eversberg.eu>
Gerrit-Reviewer: pespin <pes...@sysmocom.de>
Gerrit-MessageType: merged

Reply via email to