Use 'var &= ~(1 << x)' to reset bits instead of 'var &= (1 << x)'.
Sponsored-by: On-Waves ehf --- src/common/rsl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/common/rsl.c b/src/common/rsl.c index 8b7702b..b7dc2b5 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -331,7 +331,7 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); } else { - bts->si_valid &= (1 << osmo_si); + bts->si_valid &= ~(1 << osmo_si); LOGP(DRSL, LOGL_INFO, " RX RSL Disabling BCCH INFO (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); } @@ -445,7 +445,7 @@ static int rsl_rx_sacch_fill(struct gsm_bts_trx *trx, struct msgb *msg) LOGP(DRSL, LOGL_INFO, " Rx RSL SACCH FILLING (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); } else { - bts->si_valid &= (1 << osmo_si); + bts->si_valid &= ~(1 << osmo_si); LOGP(DRSL, LOGL_INFO, " Rx RSL Disabling SACCH FILLING (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); }
On Fri, Feb 14, 2014 at 10:28:59PM +0100, Jacob Erlbeck wrote:
Use 'var &= ~(1 << x)' to reset bits instead of 'var &= (1 << x)'.
oops. How did you find it? For how many different SI has rsl_rx_bcch_info be called? Which SI were invalid even if they should have been valid?
On Sat, Feb 15, 2014 at 12:44:43AM +0100, Holger Hans Peter Freyther wrote:
On Fri, Feb 14, 2014 at 10:28:59PM +0100, Jacob Erlbeck wrote:
Use 'var &= ~(1 << x)' to reset bits instead of 'var &= (1 << x)'.
oops. How did you find it? For how many different SI has rsl_rx_bcch_info be called? Which SI were invalid even if they should have been valid?
Ah nevermind. I didn't realize it applies to the osmo-bts. So "canceling" a SI would cause this grave defect to occurr but from what I see we don't do that.