Message ID | gerrit.1463569751064.Ibe997803ffb894133fd4d838410fe735791d414f@gerrit.osmocom.org |
---|---|
State | New |
Headers | show |
Patch Set 2: Is there any way we can get a testcase for that? With broken/odd/unusual SIs phones might never attempt to attach to a network. It would be good to have some form of regression test to make sure that with a standard config these SIs don't change.
Patch Set 4: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/81/4/openbsc/tests/gsm0408/gsm0408_test.ok File openbsc/tests/gsm0408/gsm0408_test.ok: Line 66: generated invalid SI2quater: [23] 59 06 07 c0 00 04 86 59 0a 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Can you say why it is invalid and why something is printed? Could you initialize with 0xAE before to see which bits were written?
Patch Set 4: That's how generation works for other SI - function for rest_octets is called and fills the buffer. If there's an error than buffer is not cleared, but the SI marked as invalid. I've added clarification comments into test code.
Patch Set 5: Code-Review+2
diff --git a/openbsc/src/libbsc/system_information.c b/openbsc/src/libbsc/system_information.c index 1f1d81e..8e59817 100644 --- a/openbsc/src/libbsc/system_information.c +++ b/openbsc/src/libbsc/system_information.c @@ -648,7 +648,7 @@ static int generate_si2quater(uint8_t *output, struct gsm_bts *bts) { - int rc; + int rc, i; struct gsm48_system_information_type_2quater *si2q = (struct gsm48_system_information_type_2quater *) output; @@ -667,6 +667,13 @@ if (rc < 0) return rc; + for (i = 0; i < MAX_EARFCN_LIST; i++) + if (bts->si_common.si2quater_neigh_list.arfcn[i] != + OSMO_EARFCN_INVALID) + break; + if (!bts->si_common.uarfcn_length && i == MAX_EARFCN_LIST) + bts->si_valid &= ~(1 << SYSINFO_TYPE_2quater); + return sizeof(*si2q) + rc; }