aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-07-02sql/Makefile: Create empty /var/lib/osmocom directory at install timepespin/debianPau Espin Pedrol2-0/+8
Otherwise osmo-hlr is unable to start correctly. Change-Id: I1233fc9b3dc685561f79a34e1c32c459dc1aa685
2018-07-02sql/Makefile: Install sql files under doc/.../sql subdirPau Espin Pedrol2-3/+4
Change-Id: I1c9008d4692412a0cfe39d05216fc9c857cf1e8a
2018-07-02sql/Makefile: Install hlr_data.sql as example together with hlr.sqlPau Espin Pedrol1-1/+1
Change-Id: Id4a12252b309f03bb393fa26612c305744e14403
2018-07-02debian: Avoid installing duplicate cfg file in /etcPau Espin Pedrol1-1/+0
Change-Id: Ieb25cc8195a2fe7f81b7a39955e0bca5d5c510eb
2018-06-24sql/Makefile.am: Make docsdir completely configurableMartin Hauke1-1/+1
$(docdir) defaults to $(datadir)/doc/osmo-hlr Change-Id: I77fa16d0edcf88a8e120921504cd088328077836
2018-06-24Add "show gsup-connections" VTY commandHarald Welte2-2/+35
This can help with debugging and give operational insight. Change-Id: I977b4b8cdb36dab42b3d736a28d8b5f17cff04cd
2018-06-24gsup_router: Use "#pragma once" and add missing #includesHarald Welte1-0/+5
Change-Id: I2cc43ea5846e5b98281efc897252c8dcc3ef5728
2018-06-24move osmo_gsup_addr_send() declaration from luop.h to gsup_router.hHarald Welte2-3/+4
Change-Id: I33165b7b58bd8c863083ed50ce21e3c032c579f5
2018-06-16gsup_server: Add "priv" pointer and make it point to 'struct hlr'Harald Welte3-3/+8
Change-Id: Iada68996b7f4cbdcca92b254ddaf6b88b962e6f1
2018-06-15disable blind subscriber insertion into every VLR/SGSNHarald Welte1-3/+7
During the attempt to fix OS#2785 in Change-Id I6a92ca34cdaadca9eacc774bb1ca386c325ba865, we introduced logic that would blindly insert a subscriber *concurrently* in all VLRs/SGSNs of the network on any update of the subscriber. Before that patch, we didn't update the current serving SGSN/VLR, and after the change we created subscribers in all SGSNs/VLRs, of which all-1 are not serving the subscriber at that time. We'll have to go back to the original behavior until a proper fix can be introduced. Change-Id: Ibf6f1b21b08560d4d8f41bbe7782d40abf4585f8 Related: OS#3091 Related: OS#2785
2018-06-11Return proper GSUP error in case of too short IMSIHarald Welte1-0/+28
This fixes HLR_Tests.TC_gsup_sai_err_invalid_imsi Change-Id: I4f51abdf44dfc62d7e8792341aad6dafe58923da Closes: OS#3028
2018-05-18move creation of insert subscriber data messages to a common functionStefan Sperling5-67/+103
Move code to create an Insert Subscriber Data message into a common function which can be shared by hlr.c and luop.c. As a consequence, we always encode gsup.cn_domain in the corresponding msgb and must adjust expected output of the 'gsup' test accordingly. Change-Id: I6a92ca34cdaadca9eacc774bb1ca386c325ba865 Requested-by: neels Related: OS#2785
2018-05-04Bump version: 0.2.0.3-1b8a → 0.2.10.2.1Pau Espin Pedrol1-0/+9
Change-Id: I9c457e9baeb546bfefacacddddd48996902e587a
2018-05-04add error handling to osmo_gsup_configure_wildcard_apn()Neels Hofmeyr4-8/+20
Follow-up to I83d9ef2868bbb01e3f1ddb7920fe735aca172b15 as requested in code review. Change-Id: Ifcee1e0d275741c1172b208600851861adb13238
2018-05-04add gsup_test to catch OS#3231Neels Hofmeyr11-17/+191
Encode an Insert Subscr Data with is_ps == true to trigger the encoding bug described in OS#3231, i.e. show that it is fixed. Move osmo_gsup_addr_send() to a separate .c file, so that it can be overridden in the regression test to just dump the msgb instead. I used this test to reproduce issue OS#3231, and now that it's here we might as well keep it, and possibly expand on it in the future. Related: OS#3231 Change-Id: Id1453351758f3e1a9ff03bd99fefaf51886e77da
2018-05-04fix luop crash: use buffer for APN that remains validNeels Hofmeyr4-7/+15
In osmo_gsup_configure_wildcard_apn(), do not compose APN into a local buffer that becomes invalid as soon as the function exits. Instead, use a caller provided buf. Fixes OS#3231 crash: ==20030==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7fffffffd9c0 at pc 0x7ffff6e9b6c2 bp 0x7fffffffd900 sp 0x7fffffffd0b0 READ of size 2 at 0x7fffffffd9c0 thread T0 #0 0x7ffff6e9b6c1 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x766c1) #1 0x7ffff6314419 in tlv_put ../../../../src/libosmocore/include/osmocom/gsm/tlv.h:107 #2 0x7ffff6314419 in msgb_tlv_put ../../../../src/libosmocore/include/osmocom/gsm/tlv.h:299 #3 0x7ffff6314419 in encode_pdp_info ../../../../src/libosmocore/src/gsm/gsup.c:419 #4 0x7ffff6314419 in osmo_gsup_encode ../../../../src/libosmocore/src/gsm/gsup.c:535 #5 0x555555580016 in _luop_tx_gsup ../../../src/osmo-hlr/src/luop.c:54 #6 0x5555555809d8 in lu_op_tx_insert_subscr_data ../../../src/osmo-hlr/src/luop.c:264 #7 0x55555558b356 in rx_upd_loc_req ../../../src/osmo-hlr/src/hlr.c:306 #8 0x55555558b356 in read_cb ../../../src/osmo-hlr/src/hlr.c:365 #9 0x555555586671 in osmo_gsup_server_read_cb ../../../src/osmo-hlr/src/gsup_server.c:105 #10 0x7ffff5b35911 in ipa_server_conn_read ../../../src/libosmo-abis/src/input/ipa.c:356 #11 0x7ffff5b35911 in ipa_server_conn_cb ../../../src/libosmo-abis/src/input/ipa.c:387 #12 0x7ffff5e5541f in osmo_fd_disp_fds ../../../src/libosmocore/src/select.c:216 #13 0x7ffff5e5541f in osmo_select_main ../../../src/libosmocore/src/select.c:256 #14 0x5555555791b6 in main ../../../src/osmo-hlr/src/hlr.c:600 #15 0x7ffff4707a86 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21a86) #16 0x555555579679 in _start (/usr/local/bin/osmo-hlr+0x25679) Address 0x7fffffffd9c0 is located in stack of thread T0 at offset 16 in frame #0 0x7ffff63131ff in osmo_gsup_encode ../../../../src/libosmocore/src/gsm/gsup.c:481 This frame has 1 object(s): [32, 64) 'bcd_buf' <== Memory access at offset 16 underflows this variable Related: OS#3231 Change-Id: I83d9ef2868bbb01e3f1ddb7920fe735aca172b15
2018-05-03Bump version: 0.1.0.39-1cb4-dirty → 0.2.00.2.0Pau Espin Pedrol2-5/+62
Change-Id: I2a9fdd140d68053bc7c8354bf2b3a0293c514516
2018-05-03don't forget to mark luop as a packet switched connectionStefan Sperling1-0/+1
In rx_upd_loc_req() we set the connection's supports_ps field but forgot to also set the equivalent field in the corresponding luop. Change-Id: Ie175a067ac1324cdd39d7f756a40fab923421793 Related: OS#2785
2018-05-02rewrite subscriber_update_notify() without calls into luopStefan Sperling4-21/+94
This function relied on implementation details of the luop code. Port what is necessary for an independent Insert Subscriber Data Tx operation from the luop code into this function. A next possible step would be to try to merge both of these into a common implementation. This will be addressed in a follow-up change as soon as this change is merged. The TTCN3 test TC_vty_msisdn_isd is still passing (it currently triggers the "circuit switched domain" case because it does not advertise itself as an SGSN in the IPA unit name). Change-Id: I06c43ece2b48dc63d599000eb6d6d51e08963067 Related: OS#2785
2018-04-17Remove unused src/db_test.cPau Espin Pedrol2-91/+0
There's a larger test suite in use in tests/db/db_test.c Change-Id: Ifa409df9b4bb94bd4e8f15568486066393009494
2018-04-17use osmo_init_logging2Pau Espin Pedrol6-6/+11
Change-Id: If4449cce1af46be22cc370abd3a6da8e22a31fa5
2018-04-10notify GSUP clients when HLR subscriber information changesStefan Sperling3-0/+40
Add a function which triggers subscriber update notifications to all connected GSUP clients, and invoke it when the MSISDN of a subscriber is changed via VTY. This makes the TTCN3 HLR test TC_vty_msisdn_isd pass. Note that the new function currently relies on implementation details of the Location Update Operation (luop) code. Because of this we currently log a slightly misleading message when the updated Insert Subscriber Data message is sent: "luop.c:161 LU OP state change: LU RECEIVED -> ISD SENT" This message is misleading because, in fact, no location update message was received from a GSUP client at that moment. So while this change fixes the externally visible behaviour, we may want to follow this up with some refactoring to avoid relying on luop internals. It seems acceptable to do that in a separate step since such a change will be more involved and harder to review. We may want to trigger such notifications in other situations as well. This is left for future work, too. There are no TTCN3 test cases for other situations yet, as far as I can see. Related: OS#2785 Change-Id: Iffe1d7afb9fc7dbae542f70bbf5391ddc08a14b4
2018-03-29more robust usage of osmo_timer API for osmo-hlr luop timerStefan Sperling1-2/+5
Use osmo_timer_setup() to set up the luop timer, instead of settting the timer up manually. Delete the timer before the luop is freed to prevent a potential crash in case the timer is already armed and the function call chain leading up to lu_op_free() does not cancel the timer. Found while studying code to prepare work on issue OS#2785. This change has been tested with 'make check' and TTCN3 HLR tests. Related: OS#2785 Change-Id: I1a7596675b2d94217895f0f3d3f67b86ef123c2e
2018-03-05jenkins.sh: use --enable-werror configure flag, not CFLAGSNeels Hofmeyr1-1/+1
Change-Id: I5fe776cf9ccb5d462c3c1fbbb1e31abe6f42bde6
2018-03-05configure: add --enable-werrorNeels Hofmeyr1-0/+21
Provide a sane means of adding the -Werror compiler flag. Currently, some of our jenkins.sh add -Werror by passing 'CFLAGS="-Werror"', but that actually *overwrites* all the other CFLAGS we might want to have set. Maintain these exceptions from -Werror: a) deprecation (allow upstream to mark deprecation without breaking builds); b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) As a last configure step before generating the output files, print the complete CFLAGS and CPPFLAGS by means of AC_MSG_RESULT. Change-Id: Id5c0740a37067cbe8986d52d63c6134769c71c47
2018-03-01Fix responses to PURGE MSHarald Welte1-2/+2
When performing PURGE MS, OsmoHLR before this patch used toreturn an error even in the successful case. The reasone for this is some wrong assumptions about the return values of db_subscr_purge(). Change-Id: Ie3005e2eeb424715fd77f202e9fe18464ba211b7
2018-03-01vty: Don't print error if removing auth data while none presentHarald Welte1-2/+2
It's a bit confusing to the user if he wants to set AUD=none and it's already none. Avoid printing error messages in that case. Change-Id: I5f32dd5d6e4939c738faf442c7e86671d18777f8
2018-02-14osmo-hlr: Add talloc context introspection via VTYHarald Welte3-0/+6
This requires libosmocore with Change-Id I43fc42880b22294d83c565ae600ac65e4f38b30d or later. Change-Id: Ibc2c333b83f85fa69a364e3e342f12f50dbc2f70
2018-02-09Fix expected test output after new 'logging print file 1' vty commandHarald Welte1-0/+1
Ever since libosmocore Change-Id I1c931bff1f1723aa82bead9dfe548e4cc5b685e0 was merged, the VTY tests were broken. Let's fix that by adjusting the expected test output. Change-Id: I929ca7f366220b5d1238d43eddc96fa9dde916b6
2018-01-29Add missing build products in .gitignoreAlexander Huemer1-1/+6
Change-Id: I48b93adc280c1b0521e7f5acc1f66ce5db462915
2018-01-16fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBSNeels Hofmeyr1-0/+2
Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6
2018-01-08Enable sanitize for CI testsMax1-1/+1
Change-Id: I112307b5eaf494062b2e8498ff2e9217fb8db925
2018-01-07ctrl test: fix: adjust expectations after stricter ctrl parsingNeels Hofmeyr1-8/+8
After libosmocore I96a9b6b6a3a5e0b80513aa9eaa727ae8c9c7d7a1 the CTRL interface returns stricter errors. Adjust the expectations of test_subscriber_errors.ctrl to fix the external tests on master. Change-Id: I9337b6b4f3fa8822c91760deb01f18a77a073d19
2017-12-20fix debug log: put 'deriving 2G from 3G' in proper placeNeels Hofmeyr3-3/+32
Don't log "deriving 2G from 3G" when we're actually calculating separately; log it when we're actually deriving from 3G. Add log "calculating 2G separately" in the right place. The test output changes show that each test said "separate 2G" at the top while logging "deriving 2G from 3G" further down, which was obviously wrong. Change-Id: I6679d7ef8fdcae39a0c2aff7ac638e63dddb10dc
2017-12-19fix test_subscriber_errors.ctrl after libosmocore changeNeels Hofmeyr1-2/+2
libosmocore Ie35a02555b76913bb12734a76fc40fde7ffb244d "ctrl: on parse errors, return a detailed message to sender" the test_subscriber_errors.ctrl test fails. Adjust the expected error message. Change-Id: I3aee1507721cd073f72369150d0fb3cff0fdf66f
2017-12-15contrib:jenkins.sh: Enable WerrorPau Espin Pedrol1-1/+1
Change-Id: I61688a4c9b50f6f3705bd18c96c00f8703ef5042
2017-12-15luop.c: Transform FIXME from warning to pragma messagePau Espin Pedrol1-2/+1
This way the issue is still visible but we can enable Werror to avoid introducing new warnings. Change-Id: I6c9b195bf0e3f853e202cdbdb72d35d83cd2a2ab
2017-12-01Remove unused ipa.pyMax1-278/+0
Change-Id: I0a6c22f38480ae75ae9efb452e4eeacb39ae4f42
2017-11-29db_test: also test db_get_auc() return valuesNeels Hofmeyr2-5/+80
Verify that it returns -ENOENT on non-existing IMSI and -ENOKEY for no auth data. Move the auc_compute_vectors() stub to the top near the db_get_auc() call, and just return num_vec to get a successful return value when auth data is present. Change-Id: Ic0158228afbd78b8ca21f62dffa9f868674682b9
2017-11-29osmo-hlr: log details for unknown IMSI / no auth data / db errorNeels Hofmeyr1-0/+7
For unknown IMSI and no auth data for a known IMSI, log respective messages on NOTICE level. For database error, log on ERROR level. Change-Id: I3838fa78567e7e92d797d90b8b90865d9ebba90a
2017-11-29db_get_auth_data / db_get_auc: clarify return valuesNeels Hofmeyr6-34/+53
Differentiate between "IMSI unknown" and "IMSI has no auth data": in case of known IMSI lacking auth data, return -ENOKEY instead of -ENOENT. Fix API doc comments to reflect what the functions actually return, on top of adding the -ENOKEY detail. Adjust db_test expectations from -ENOENT to -ENOKEY where appropriate. Adjust VTY and CTRL command rc evaluation. A subsequent patch will use these return values to log details on each of these situations. Change-Id: Icf6304d23585f2ed45e050fa27c787f2d66fd3f7
2017-11-24Remove unused checkMax1-4/+2
We do not test on FreeBSD in jenkins anymore. Change-Id: I1578306244f6ee218e464a6c378ff60605cf1d5c
2017-11-22return GMM_CAUSE_IMSI_UNKNOWN if there is no auth dataNeels Hofmeyr1-0/+1
If we have a subscriber entry that lacks auth data, we currently return GMM_CAUSE_NET_FAIL, which in the MSC log looks like the HLR is not connected or something grave. Instead, return GMM_CAUSE_IMSI_UNKNOWN. This changes the OsmoMSC log in this way: Before: DVLR <001e> VLR_Authenticate(901700000014701)[0x5555558dabb0]{VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: GSUP: rx Auth Info Error cause: 17: Network failure After: DVLR <001e> VLR_Authenticate(901700000014701)[0x5555558dabb0]{VLR_SUB_AS_NEEDS_AUTH_WAIT_AI}: GSUP: rx Auth Info Error cause: 2: IMSI unknown in HLR A better cause value would be something that says "IMSI known, but we have no auth data", but since such cause value is not defined, the plain "IMSI unknown" seems to be the best match. Change-Id: I90df7b255317df1e5d968e7ce3b9d2c404b98db8
2017-11-22cosmetic: rx_send_auth_info(): decide error cause with switch()Neels Hofmeyr1-5/+9
Prepare for tweaking error handling in a subsequent patch: use switch() instead of if(). Prepares-for: I90df7b255317df1e5d968e7ce3b9d2c404b98db8 Change-Id: I1f628aa9d62b778951726bebec8cf338444fc897
2017-11-21db_test: don't verify SQLite issued error messages, they might changeNeels Hofmeyr7-14/+13
A user on openbsc@ complained that with SQLite 3.8.2, the db_test fails with --- expected +++ stderr -DDB (2067) abort at 18 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi +DDB (2067) abort at 35 in [INSERT INTO subscriber (imsi) VALUES ($imsi)]: UNIQUE constraint failed: subscriber.imsi i.e. a trivial difference in the error message issued by SQLite. For db_test, don't output any SQLite error messages: Add argument enable_sqlite_logging, pass as true, except in db_test.c. Remove the SQLite error messages from expected output. (Note that there is a src/db_test.c program that's not of interest here, this is about the tests/db/db_test.c) Change-Id: I2513d71cc0072aef8d08f47d0a1959f311176229
2017-11-18add --enable-sanitize config optionNeels Hofmeyr1-0/+12
Change-Id: I12b7b0e751f274a05e88c79299fd8388667cc542
2017-11-17debian: install osmo-hlr.cfg to /etc/osmocomAlexander Couzens1-0/+1
Change-Id: Ifa1094da9b286a17a5c9a1ee300ec13a4a10a9a7
2017-11-17doc: install example .cfg files to $(docdir)/examples/Alexander Couzens4-0/+25
Change-Id: I8671ce33b9bf28c89f767dd1b4a1463aeb275158
2017-11-16debian: include systemd service osmo-hlr.serviceAlexander Couzens1-0/+1
Change-Id: I6d9fd34aa42b911f074557b526adde05e03d58b9
2017-11-12db-tool: error-exit on too many argumentsNeels Hofmeyr1-0/+6
Each arg parsing should increment optind, so if there are any surplus args in the end, that's an error. Change-Id: I9fc0a87d11db8c35061568e3f8b5a5547931a961