[OML] fix bugs in BCCH info parser for ip.access

This commit is contained in:
Harald Welte 2009-11-13 14:41:52 +01:00
parent 999549d9ae
commit aff237d739
2 changed files with 6 additions and 4 deletions

View File

@ -701,7 +701,7 @@ struct ipac_bcch_info {
u_int16_t arfcn;
u_int8_t rx_lev;
u_int8_t rx_qual;
u_int16_t freq_err;
int16_t freq_err;
u_int16_t frame_offset;
u_int32_t frame_nr_offset;
u_int8_t bsic;

View File

@ -2731,8 +2731,8 @@ void ipac_parse_cgi(struct cell_global_id *cid, const u_int8_t *buf)
cid->mnc += (buf[1] >> 4) * 1;
}
cid->lac = ntohs(buf+3);
cid->ci = ntohs(buf+5);
cid->lac = ntohs(*((u_int16_t *)&buf[3]));
cid->ci = ntohs(*((u_int16_t *)&buf[5]));
}
/* parse BCCH information IEI from wire format to struct ipac_bcch_info */
@ -2750,6 +2750,8 @@ int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf)
len = ntohs(*(u_int16_t *)cur);
cur += 2;
DEBUGP(DNM, "bcch info: %s\n", hexdump(cur, len));
binf->info_type = ntohs(*(u_int16_t *)cur);
cur += 2;
@ -2780,7 +2782,7 @@ int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf)
cur += 4;
if (binf->info_type & IPAC_BINF_BSIC)
binf->bsic = *cur++ & 0x3f;
binf->bsic = *cur & 0x3f;
cur++;
ipac_parse_cgi(&binf->cgi, cur);