lapdm: some more error reporting in case strange primitives arrive from L1
authorHarald Welte <laforge@gnumonks.org>
Fri, 24 Jun 2011 13:28:02 +0000 (15:28 +0200)
committerHarald Welte <laforge@gnumonks.org>
Fri, 24 Jun 2011 13:28:02 +0000 (15:28 +0200)
src/host/layer23/src/common/lapdm.c

index fee221f..1d0a80a 100644 (file)
@@ -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: