summaryrefslogtreecommitdiffstats
path: root/src/host/layer23
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-06-24 15:28:02 +0200
committerHarald Welte <laforge@gnumonks.org>2011-06-24 15:28:02 +0200
commit619038bc9d127b78e40161672ff26102c48e199b (patch)
tree717dae6fc53ab1522745114d3fa9b1075c40417f /src/host/layer23
parenta9da9b730df492857f1a6ad82c3c98aa1f799d56 (diff)
lapdm: some more error reporting in case strange primitives arrive from L1
Diffstat (limited to 'src/host/layer23')
-rw-r--r--src/host/layer23/src/common/lapdm.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/host/layer23/src/common/lapdm.c b/src/host/layer23/src/common/lapdm.c
index fee221f3..1d0a80a5 100644
--- a/src/host/layer23/src/common/lapdm.c
+++ b/src/host/layer23/src/common/lapdm.c
@@ -1663,22 +1663,28 @@ int lapdm_phsap_up(struct osmo_prim_hdr *oph, struct lapdm_entity *le)
struct osmo_phsap_prim *pp = (struct osmo_phsap_prim *) oph;
int rc = 0;
- if (oph->sap != SAP_GSM_PH)
- return -ENODEV;
-
- if (oph->operation != PRIM_OP_INDICATION)
+ if (oph->sap != SAP_GSM_PH) {
+ LOGP(DLAPDM, LOGL_ERROR, "primitive for unknown SAP %u\n",
+ oph->sap);
return -ENODEV;
+ }
switch (oph->primitive) {
case PRIM_PH_DATA:
- if (oph->operation != PRIM_OP_INDICATION)
+ if (oph->operation != PRIM_OP_INDICATION) {
+ LOGP(DLAPDM, LOGL_ERROR, "PH_DATA is not INDICATION %u\n",
+ oph->operation);
return -ENODEV;
+ }
rc = l2_ph_data_ind(oph->msg, le, pp->u.data.chan_nr,
pp->u.data.link_id);
break;
case PRIM_PH_RTS:
- if (oph->operation != PRIM_OP_INDICATION)
+ if (oph->operation != PRIM_OP_INDICATION) {
+ LOGP(DLAPDM, LOGL_ERROR, "PH_RTS is not INDICATION %u\n",
+ oph->operation);
return -ENODEV;
+ }
rc = l2_ph_data_conf(oph->msg, le);
break;
case PRIM_PH_RACH: