[abis_nm] fix 2 bugs in parsing IPA Test response messages

This commit is contained in:
Harald Welte
2010-07-22 18:14:36 +02:00
parent a0b0f36ff0
commit af109b9fa9

View File

@@ -2963,7 +2963,7 @@ int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf)
u_int8_t *cur = buf; u_int8_t *cur = buf;
u_int16_t len; u_int16_t len;
memset(binf, 0, sizeof(binf)); memset(binf, 0, sizeof(*binf));
if (cur[0] != NM_IPAC_EIE_BCCH_INFO) if (cur[0] != NM_IPAC_EIE_BCCH_INFO)
return -EINVAL; return -EINVAL;
@@ -2978,7 +2978,7 @@ int ipac_parse_bcch_info(struct ipac_bcch_info *binf, u_int8_t *buf)
if (binf->info_type & IPAC_BINF_FREQ_ERR_QUAL) if (binf->info_type & IPAC_BINF_FREQ_ERR_QUAL)
binf->freq_qual = *cur >> 2; binf->freq_qual = *cur >> 2;
binf->arfcn = *cur++ & 3 << 8; binf->arfcn = (*cur++ & 3) << 8;
binf->arfcn |= *cur++; binf->arfcn |= *cur++;
if (binf->info_type & IPAC_BINF_RXLEV) if (binf->info_type & IPAC_BINF_RXLEV)