aboutsummaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2021-08-24vlr_sgs: Balance use_count incremented in vlr_sgs_loc_updatePau Espin Pedrol1-1/+6
During a recent pcap trace, it was spotted that subscriber coming from SGs had a use count with 16 "SGs" items, and later it incremented to 17. Further investigation shows that the related use_count item was never decreased, meaning every time an SGs-LU was sent by the MME, the item was incremented further and never decremented. Let's rename the item to be referenced while in LU, and then decremented when LU is done. At that time, either the LU was accepted and the subscriber object has a use_count item "attached", or it was rejected and we already sent the reject messages, so we are fine deleting it if needed. Related: SYS#5337 Change-Id: I22c386f02ffa57428f700b003cc2cf23133598d0
2021-08-24vlr_sgs.c: Fix missing use_count decrease in vlr_sgs_imsi_detachPau Espin Pedrol1-1/+3
it was recently observed in a pcap trace with gsmtap_log that the use_count contained a "vlr_sgs_imsi_detach" item despite no related message was seen near by. Further investigation shows that there's an unbalanced get+put code path, introduced by an early return added to fix another issue. related: SYS#5337 Fixes: 0803d88d9aa6ff36896fbde218018db3bea61dc7 Change-Id: I91ae956e50fca2f4d0e1d145d60ccb0ebfb409e9
2021-08-24vlr_auth_fsm.c: Simplify function auth_fsm_wait_ai_resyncPau Espin Pedrol1-7/+3
Change-Id: I2070002dea18b728deef5547b4deb6166cfcab6a
2021-08-24cosmetic: fix typos in commentsPau Espin Pedrol1-3/+3
Change-Id: I89e8eba379f83bcf3061601b02af9f10dbca0f22
2021-07-29implement CM Re-Establish for voice callsNeels Hofmeyr2-2/+130
Related: SYS#5130 Change-Id: I6fa37d6ca9fcb1637742b40e37b68d67664c9b60
2021-07-28add vlr_subscr_find_by_miNeels Hofmeyr1-0/+15
Will be used by I6fa37d6ca9fcb1637742b40e37b68d67664c9b60 "implement CM Re-Establish for voice calls" Related: SYS#5130 Change-Id: I5291d098a02268bd1c2e30195ae61e4a13e8709c
2021-07-12msc_a.c: Allow MSC_A_EV_CN_CLOSE in state MSC_A_ST_RELEASINGPau Espin Pedrol1-0/+1
As seen in a running osmo-msc: "vlr_access_req_fsm.c:153 msc_a(IMSI-....:MSISDN-...:TMSI-0x...:GERAN-A-8:CM_SERVICE_REQ){MSC_A_ST_RELEASING}: Event MSC_A_EV_CN_CLOSE not permitted" Also seen in several unit tests, which need update. The action event handler for that state is actually already expecting/handling the event by ignoring it, so we should allow it. Change-Id: I4d30cffab693529aab3ba736419dec116a4dd7ef
2021-07-12sgs_iface.c: Improve logging when paging over SGsPau Espin Pedrol1-3/+3
Change-Id: I745d3e904583ddf170ec1a1ceac5a49b72e813e3
2021-07-02vlr_sgs: Drop recorded LastEutranPlmnId when UE no longer associatedPau Espin Pedrol1-0/+4
Change-Id: I0dcb1850ab4f6f7d42bfcb19665ddeae2d3b057a
2021-07-01sgs: Use available API to set vlr subscr LastUsedEutranPLMNIdPau Espin Pedrol1-6/+8
This way it's easier to find out where the vlr subscriber field is set. Change-Id: I203de82accc896c196cb70037af89be6dc826c05
2021-06-24improve logging on encryption, for Ciphering and HOneels/a54Neels Hofmeyr2-2/+14
log the algorithm and all keys instead of just Kc. Change-Id: If7871dedda2b1fb115e6f00da1379ff2e3d68a10
2021-06-24support A5/4 in inter-BSC handoverNeels Hofmeyr1-0/+12
Forward the Kc128 key to the new BSS in BSSMAP Handover Request. Depends: Ieb6e43eef9e57281d54d4b7c63664668df5aef3e (libosmocore) Change-Id: Id5ce995a741c8e469a50a0c46e53c06a2378bb7e
2021-06-24support A5/4 in Cipher Mode CommandNeels Hofmeyr2-3/+33
Related: SYS#5324 Change-Id: I780a739b9bfbefd4f58be051794fe1a491823e67
2021-06-24vty: allow A5/4 encryption in configEric Wild1-1/+2
Add A5/4 to the internal mask of allowed algorithms. (Not actually working yet, A5/4 implementation follows in other patches.) Related: SYS#5324 Change-Id: I5b46aaa8579f8d069ca39caf996a8795ffe63dd7
2021-06-23ran_msg_a.c: use gsm0808_create_cipher2()Neels Hofmeyr1-13/+16
Use new API in Cipher Mode Command to prepare for A5/4 support. Depends: Ib3906085e0c6e5a496a9f755f0f786238a86ca34 (libosmocore) Related: SYS#5324 Change-Id: Ib238d367b8d5d07b6ab4cb2e48fbf4ce22ca4476
2021-06-22osmo-msc main: use osmo_select_shutdown()Neels Hofmeyr1-5/+15
Change-Id: I75f4637c051ed44628e65dab1bdbbf28dcc9626f
2021-06-06msc_tx_common_id(): fix potential NULL pointer dereferenceVadim Yanitskiy1-0/+2
Reported by GCC 11.1.0. msc_a_vsub() may return NULL. Change-Id: Iebdd6399e819a03258398e6b7b453bda37e45a20
2021-06-04Use new osmo stat items/ctr APIsPau Espin Pedrol7-64/+61
Generated using several semantinc patches with spatch. Change-Id: I3ee853539949a763a309856bf2e7196415b23741
2021-04-29Fill Last Used E-UTRAN PLMN Id when in CSFBPau Espin Pedrol6-4/+79
Since recently, osmo-bsc behaves strictly as per specs, meaning it will only send the "Cell selection indicator after release of all TCH and SDCCH IE" in RR Channel Release iff: * "Last Used E-UTRAN PLMN Id" was received in the CommonID sent MSC->BSC * "Last Used E-UTRAN PLMN Id" was received insider "old BSS to new BSS Information" in the HandoverRequest sent MSC->BSC. On the other hand, CSFB_Indicator from ClearCommand MSC->BSC is nw ignored and not taken into account. Hence, let's update osmo-msc to also behave correctly by sending the Last Used E-UTRAN PLMN ID at CommonID tx time to avoid regressions in CSFB support when running against newer osmo-bsc. Let's keep sending the CSFB Indicator in ClearCommand as we used too, in order to keep compatibility with older BSCs (as per spec). Related: SYS#5337 Change-Id: Ic5f175b179973d0a50d94f00e15f5a3e332605fc
2021-04-04SMS-over-GSUP: notify sender if no transaction foundVadim Yanitskiy1-1/+2
Change-Id: I4f564610fadbfdbbc33de267786534a5405319f6
2021-02-09fix _gsm48_cc_trans_free(): send MNCC REL.ind on Clear RequestVadim Yanitskiy1-5/+7
Calling gsm48_cc_tx_release() before mncc_release_ind() has a side effect: the former may change CC state to GSM_CSTATE_RELEASE_REQ. This makes the later send MNCC_REL_CNF instead of MNCC_REL_IND, so if one of the call leg disconnects due to RF failure, the other one will not be terminated correctly. Makes both TC_{mo,mt}_call_clear_request TTCN-3 test cases pass. Change-Id: I3ad4a99757878de3796027325627c87d9a4e93f1 Related: Id16969fe0de04445d1320a96d35cf1d48cc8cf09 Related: SYS#5340
2021-02-05ran_a_decode_cipher_mode_reject(): use gsm0808_get_cause()Vadim Yanitskiy1-1/+1
Change-Id: I56dd920b931e769ba4d268b09700fe3c9fca4fc6
2021-02-05submit_to_sms(): fix the use of deprecated gsm_septets2octets()Vadim Yanitskiy1-2/+1
Change-Id: I9985972f0b1d2b71bfd133c5004201a3a0ffcbd0
2020-11-25main: generate coredump and exit upon SIGABRT receivedPau Espin Pedrol1-6/+15
Previous code relied on abort() switching sigaction to SIG_FDL + retriggering SIGABRT in case the signal handler returns, which would then generate the coredump + terminate the process. However, if a SIGABRT is received from somewhere else (kill -SIGABRT), then the process would print the talloc report and continue running, which is not desired. Change-Id: Iff66eea9ee70850a4d038ece1d8473457023e1ee Fixes: OS#4865
2020-11-11Use osmo_fd_*_{disable,enable}Harald Welte1-6/+6
Change-Id: I5208124e08d3b403492fe83acee235e61e423450 Depends: libosmocore.git Idb89ba7bc7c129a6304a76900d17f47daf54d17d
2020-10-24main: add --vty-ref-mode, use vty_dump_xml_ref_mode()Vadim Yanitskiy1-11/+34
Change-Id: I66c3521895dd0b9a35e9b75f7766ec8014116246 Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40 Related: SYS#4910
2020-10-19Use osmo_fd_setup() whenever applicableHarald Welte2-12/+3
Change-Id: Ib570e2ada619b72001d76d2cae159d78f09d6fb6
2020-09-26Convert paging response timer into an osmocom own X4 timerAlexander Couzens4-10/+21
All timeout values should use tdef. Change-Id: Ic050eb49ba0c5811b43d8d8b44145a1115fd8546
2020-09-25gsm_04_08: check return code of osmo_mobile_identity_decode_from_l3()Philipp Maier1-1/+6
The function gsm48_rx_cm_reest_req() is the only one where the return code of osmo_mobile_identity_decode_from_l3() is not checked, lets check it here too. Change-Id: I37981205870b094b3a40a20197461208daa62698 Fixes: CID#211037
2020-09-25drop duplicate ran_peer_find() vs ran_peer_find_by_addr()Neels Hofmeyr1-13/+2
This is the same function existing twice with different names. Keep only one. Change-Id: If54b54fa61ece0f95564d403e1439fc5f5ededdf
2020-09-22Don't Store an SMS in the database when the ESME is not BoundKeith Whyte1-0/+10
We may never be able to deliver this SMS if it depends on the ESME, as we will not resubmit the SMS to the ESME. Better to reject it at this time and have the MS try again later. Change-Id: I2c50904349dd4ed229b60b8468d776b817c0bd44 Related: OS#4740
2020-09-18mncc_call: fix memory overrunPhilipp Maier1-8/+9
The struct gsm_mncc which is created and populated in mncc_call_tx_setup_ind casted to a union mncc_msg* pointer. This leads to a memory overrun in mncc_call_tx because the union mncc_msg is larger then the gsm_mncc struct. To fix this, lets just declare a union mncc_msg and populate the signal member inside it. This can be handed over to mncc_call_tx. The data in it will look the same, except that the memory will have the proper lenght (longer). Change-Id: Ifff28b3375d6bd5e4f837f25c46736952f7bfa9b Fixes: CID 214330
2020-09-18fix MGCP timeout timerNeels Hofmeyr1-1/+1
Timer X1 is not defined in libosmo-mgcp-client, so this tdef had no effect. Change this to X2427. (libosmo-mgcp-client recently moved T2427001 to X2427.) (X2 is still used in call_leg.c itself) Related: OS#4539 Related: If097f52701fd81f29bcca1d252f4fb4fca8a04f7 (osmo-mgw) Change-Id: I9804fdb2c24f49910f2386e3788bd1107b8ebc40
2020-09-14mncc: Support IPv6 addresses (new version mncc 7)pespin/ipv6Pau Espin Pedrol3-10/+17
Change-Id: I6002b648bcb2055dcbbdae3f688f6e2cb7282b7f
2020-09-09Support handling IPv6 Transport Address in Handover Request (Ack)Pau Espin Pedrol1-34/+14
Change-Id: Ie4d07826362d651cd42dc2b4e0af82368a74c774
2020-09-08Support handling IPv6 Transport Address in Assignment CompletePau Espin Pedrol1-10/+1
Change-Id: Ib650bb063404a3068b4cf3c376c6080dc29bebfe
2020-09-08Support sending IPv6 Transport Address in Assignment CommandPau Espin Pedrol1-17/+40
Change-Id: Ida43f10a41afbd275233f0ef102287522a2e7099
2020-08-28vty: allow configuring db path from cfg fileKeith Whyte3-3/+19
So far, the cmdline argument was the only way to set a database file. Add a similar config to VTY as 'msc' / 'sms-database'. The cmdline arg is stronger than the 'database' cfg item. DB is not reloaded from VTY command. Change-Id: I18d954c30fcceb0b36a620b927fd3a93dcc79f49
2020-08-24Change default SCTP conn NULL->127.0.0.1 to localhost->localhostPau Espin Pedrol1-2/+3
"127.0.0.1" is changed to "localhost" to let local NSS decide whether to use IPv4 or IPv6. In newish systems, IPv6 ::1 will be selected since IPv6 takes precedence over IPv4. Similarly, the default source addr needs to be changed from NULL to "localhost" since for some yet unknwon reason, getaddrinfo(AF_UNSPEC, NULL) returns first IPv4 "0.0.0.0" and later "::", which is inconsistent with getaddrinfo("localhost") result, resulting in src=IPv4(0.0.0.0) and dst=IPv6(::1), which is incompatible and will fail. In any case, since the default remote address is a local one and it's the client side, there's no real logical change since the kernel would anyway should have taken a local address anyway. Change-Id: I05a5c792ab1d053c6f38ba36d4b9fa6db293fbd0
2020-08-24mncc_builtin: log type of unhandled message in int_mncc_recv()Vadim Yanitskiy1-1/+2
Change-Id: Ie65b2da4c3a13ac36132a2f8c9c85cc420c7a5a6
2020-08-24mncc_builtin: cosmetic: fix coding style in int_mncc_recv()Vadim Yanitskiy1-1/+1
Change-Id: Iffef3c094a5d030663d312a379e846a8eb917942
2020-08-24fix crash for unknown MI during Paging ResponseNeels Hofmeyr1-1/+6
Related: OS#4724 Related: I40496bbccbbd9c496cfa57df49e26f124a2b1554 (osmo-ttcn3-hacks) Change-Id: Ia2c8fa745cfab17ed7114d433f625ddc02ae7b11
2020-08-20Support setting rt-prio and cpu-affinity mask through VTYPau Espin Pedrol1-0/+2
Change-Id: I40cf8a86961c1e350b5cd74d6e2cf64a22b7a2b1 Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c Related: SYS#4986
2020-08-17Send "BSSMAP CommonID" to tell BSC about the IMSIHarald Welte3-14/+11
We're already sending the RANAP CommonID message to the RNC, let's do the same using BSSMAP CommonId towards the BSC. This way the BSC knows about the IMSI of the served subscriber, which is very useful for logging/debugging. Change-Id: I2552736477663adb250c55728093500e8ae83ebb Closes: OS#2969 Depends: libosmocore.git I353adc1aa72377f7d4b3336d2ff47791fb73d62c
2020-07-29vty: fix vsub reference counting: call vlr_subscr_put()Vadim Yanitskiy1-0/+2
Otherwise, each time the 3GPP TS 44.014 MS test commands (TCH loop) are invoked, both subscriber_mstest_{close,open} functions add +1 to the subscriber's reference count, but never revoke it. Change-Id: I0cefa5b5a0cb712080ba2afd322db329f19608e3
2020-07-29gsm_04_14: fix off-by-one error in create_gsm0414_msg()Vadim Yanitskiy1-1/+1
This byte is redundant, and must not be allocated in this function. A consequence of this error is that the MS alwats interprets the "Sub-channel" IE as test loop A regardless of the specified type. Here is an example of malformed Close TCH loop (type C) message: 0f 00 00 04 x. .. .. .. - Skip indicator (see 3GPP TS 24.007) .x .. .. .. - Protocol discriminator (see 3GPP TS 24.007) .. xx .. .. - Message type (CLOSE_TCH_LOOP_CMD) .. .. !! .. - (!) Redundant byte from create_gsm0414_msg() .. .. .. xx - (!) The actual "Sub-channel" IE (loop C, X=0) Change-Id: Ia47225b884439dcd43be307e7351994e55fcd50d
2020-07-28Clear Command: set cause value to "Call Control"Neels Hofmeyr1-0/+3
So far, by failing to initialize the cause value, we always send a Clear Command cause == 0, which actually means "Radio Interface Message Failure". This is seen in all my logged network traces of osmo-msc lab testing. "Call Control" seems to be the only cause value that remotely fits a normal release procedure, even if it was not voice call related, see 3GPP TS 48.008 3.2.1.21. Related: OS#4664 Change-Id: I1347ed72ae7d7ea73a557b866e764819c5ef8c42
2020-07-09is_reset_msg: use proper enum for rc valueNeels Hofmeyr1-5/+5
Change-Id: I88b6204bc3ffac06f92bfc87639ce503b2da24bc
2020-07-01sgs_tx_loc_upd_resp_cb(): fix error handling for MI encodingNeels Hofmeyr1-2/+8
new_id_ptr should be passed as NULL if encoding the TMSI failed, so initialize it accordingly. Also add some bloat to better handle the case of an encoding error, even though from code analysis that should not be possible here: there is enough buffer, the MI is a TMSI encoded from a uint32_t... The problem was introduced by Idfc8e576e10756aeaacf5569f6178068313eb7ea, before which new_id_len was always 0 when no TMSI was present. Related: CID#210894 Change-Id: I800c5dca3fdbdedf70a64d9fd5a1bdfd1397f431
2020-07-01refactor: move RESET Osmux TLV parsing to ran_msg_a.cNeels Hofmeyr3-22/+51
ran_peer.c is not the proper place to parse messages, because it should be RAN agnostic. All parsing and encoding belongs in ran_msg_a.c and ran_msg_iu.c. Move the Osmux TLV parsing into the is_reset_msg op: add supports_osmux out-parameter (and add a logging fi pointer). To be able to modify msg->l3h, also make the msgb arg non-const. In ranap_is_reset_msg(), always return non-support for Osmux. In bssmap_is_reset_msg(), return 0 if no TLVs were parsed, 1/-1 if an Osmux TLV was present/not present. Update the osmux support flag directly where the ConnectionLess message is received, so that there is only one place responsible for that. Related: OS#4595 Change-Id: I1ad4a3f9356216dd4bf8c48fba29fd23438810a7