diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-06-16 21:51:36 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-06-16 21:51:36 +0200 |
commit | f3405e5b0342362d5d592f013014847a4dc135d8 (patch) | |
tree | 9477ce240d875c39ae06b5f046aa877090933d00 /src/sysmo_l1_if.c | |
parent | 6d8884de490d09902e9e31a90bab9ef490ef5d82 (diff) |
sysmobts: Add a hot-fix to avoid dumping -1 amount of data
Diffstat (limited to 'src/sysmo_l1_if.c')
-rw-r--r-- | src/sysmo_l1_if.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/sysmo_l1_if.c b/src/sysmo_l1_if.c index b03fad0e..4274e77f 100644 --- a/src/sysmo_l1_if.c +++ b/src/sysmo_l1_if.c @@ -168,17 +168,28 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1h, { int rc = 0; - gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, - data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, - data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, - data_ind->msgUnitParam.u8Size-1); - DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s", get_value_string(femtobts_l1sapi_names, data_ind->sapi), data_ind->hLayer2, osmo_hexdump(data_ind->msgUnitParam.u8Buffer, data_ind->msgUnitParam.u8Size)); + /* + * TODO: Add proper bad frame handling here. This could be used + * to switch the used CS. Avoid a crash with the PCU right now + * feed "0 - 1" amount of data. + */ + if (data_ind->msgUnitParam.u8Size == 0) + return -1; + + gsmtap_send(fl1h->gsmtap, data_ind->u16Arfcn | GSMTAP_ARFCN_F_UPLINK, + data_ind->u8Tn, GSMTAP_CHANNEL_PACCH, 0, + data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, + data_ind->msgUnitParam.u8Size-1); + + + + switch (data_ind->sapi) { case GsmL1_Sapi_Pdtch: case GsmL1_Sapi_Pacch: |