SI 5*/6 require L2 header of 0x03,0x03. All SI might be less than 23
octets, so they need to be filled with 0x2b.
---
 src/common/rsl.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/common/rsl.c b/src/common/rsl.c
index 150f686..128990d 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -314,6 +314,7 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct 
msgb *msg)
                if (len > sizeof(sysinfo_buf_t))
                        len = sizeof(sysinfo_buf_t);
                bts->si_valid |= (1 << osmo_si);
+               memset(bts->si_buf[osmo_si], 0x2b, sizeof(sysinfo_buf_t));
                memcpy(bts->si_buf[osmo_si],
                        TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len);
                LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s)\n",
@@ -323,6 +324,7 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct 
msgb *msg)
                if (len > sizeof(sysinfo_buf_t))
                        len = sizeof(sysinfo_buf_t);
                bts->si_valid |= (1 << osmo_si);
+               memset(bts->si_buf[osmo_si], 0x2b, sizeof(sysinfo_buf_t));
                memcpy(bts->si_buf[osmo_si],
                        TLVP_VAL(&tp, RSL_IE_L3_INFO), len);
                LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s)\n",
@@ -437,6 +439,7 @@ static int rsl_rx_sacch_fill(struct gsm_bts_trx *trx, 
struct msgb *msg)
                bts->si_valid |= (1 << osmo_si);
                bts->si_buf[osmo_si][0] = 0x03; /* C/R + EA */
                bts->si_buf[osmo_si][1] = 0x03; /* UI frame */
+               memset(bts->si_buf[osmo_si]+2, 0x2b, sizeof(sysinfo_buf_t)-2);
                memcpy(bts->si_buf[osmo_si]+2,
                        TLVP_VAL(&tp, RSL_IE_L3_INFO), len);
                LOGP(DRSL, LOGL_INFO, " Rx RSL SACCH FILLING (SI%s)\n",
@@ -727,8 +730,9 @@ static int rsl_rx_chan_activ(struct msgb *msg)
                        if (copy_len > sizeof(sysinfo_buf_t)-2)
                                copy_len = sizeof(sysinfo_buf_t)-2;
                        lchan->si.valid |= (1 << osmo_si);
-                       lchan->si.buf[osmo_si][0] = 0x00;
+                       lchan->si.buf[osmo_si][0] = 0x03;
                        lchan->si.buf[osmo_si][1] = 0x03;
+                       memset(lchan->si.buf[osmo_si]+2, 0x2b, 
sizeof(sysinfo_buf_t)-2);
                        memcpy(lchan->si.buf[osmo_si]+2, cur, copy_len);
 
                        cur += si_len;
@@ -1046,8 +1050,9 @@ static int rsl_rx_sacch_inf_mod(struct msgb *msg)
                if (len > sizeof(sysinfo_buf_t)-2)
                        len = sizeof(sysinfo_buf_t)-2;
                lchan->si.valid |= (1 << osmo_si);
-               lchan->si.buf[osmo_si][0] = 0x00;
+               lchan->si.buf[osmo_si][0] = 0x03;
                lchan->si.buf[osmo_si][1] = 0x03;
+               memset(lchan->si.buf[osmo_si]+2, 0x2b, sizeof(sysinfo_buf_t)-2);
                memcpy(lchan->si.buf[osmo_si]+2,
                        TLVP_VAL(&tp, RSL_IE_L3_INFO), len);
                LOGP(DRSL, LOGL_INFO, "%s Rx RSL SACCH FILLING (SI%s)\n",
-- 
1.8.1.5


Reply via email to