The BVCI IE is listed as conditional and is only included if the flush
action indicates that LLC-PDUs are transferred. (3GPP TS 48.018 Ch.
10.4.2).
The code in gbprox_rx_sig_from_bss unconditionally tries to get a BVCI
from a FLUSH_LL message which could result in a segfault if no such IE
is included. Routing towards the SGSN can happen simply based on TLLI (for pooling)
since there is only one signalling BVC towards the SGSN.
Related: OS#5332
Change-Id: I659f9c925bb38b8cf2348b84b976142d8d4693f7
The ra_id as well as the cell_id are already present in struct
gbproxy_cell which is reachable from bvc->cell. Remove the ra_id in
struct gbproxy_bvc and also remove some unused/unneeded code. The FSM
reset_notif callback already takes care of updating the cell.
Related: OS#4894
Change-Id: Ibc9f42a60706612c17e5f8f0468c7faced5ae4c8
This code was copied in BSS and SGSN PTP receive functions and also in
the functions that extract the inner PDU-in-error from the STATUS PDU.
Use a central function for less code duplication and better
maintainability.
This also fixes TTCN3 test TC_status_ptp_ul_tlli the c&p omitted the
special handling of UL/DL unitdata.
Related: OS#4892
Change-Id: I882aa97b0f4158affe45e81e4e4701bd36ef89f7
Derive a foreign TLLI from a TMSI and route the message according to it
Fixes TC_status_sig_ul_tmsi
Related: OS#4892
Change-Id: Iebda9e9fd433cd28c0f657adc4d475d4e6e247ba
Handle SGSN BVCs that are gone from the BSS differently.
The previous patch removed the gbproxy_bvc on the SGSN-side after it was
gone on the BSS-side. This caused a STATUS response to BVC_BLOCK_ACK messages
that should be valid. Instead of removing the BVC this patch marks it as
inactive so we can still handle BVC_BLOCK_ACK correctly, but ignore
other messages - especially BVC_RESET from the SGSN.
Related: SYS#5628. OS#5236
Change-Id: Ic9f34a27412d6e15ca1198ee140f66a076b5c6b6
If we keep the bvc around the SGSN could send a BVC-RESET which the
gbproxy would ACK. This will reestablish the BVC only between the gbproxy and
SGSN which can lead to all sorts of issues.
With this patch the gbproxy will respond with a BVC-STATUS cause BVCI
unknown.
Related: SYS#5628
Fixes: OS#5236
Change-Id: Ib14be6425a81b43353708b2708f79e035e501079
Both ctrl commands gbproxy-state and number-of-peers should only
operate on PtP-BVCs. This patch avoids a crash in gbproxy-state and
fixes the count of number-of-peers to only include PtP-BVCs.
Related: SYS#5542, OS#5200
Change-Id: Ida5f9ad0a16b991e77eec0e3cdb779dcfa472fab
ctrl_nsvc_state_cb() expects us to pass a struct nsvc_cb_data so do that
instead of passing only the ctrl_cmd.
Related: OS#5200, SYS#5542
Change-Id: I8bc67cc9bc90dab9cfca30b062d1d78897aa1e51
This patch adds gbproxy_cell_cleanup_bvc() which removes the bvc pointer
to the cell. If the BSS BVC of this cell is removed it frees the whole
cell (removing all the SGSN BVC pointers to the cell). The SGSN-side
BVCs are blocked at this point and will only be reestablished if this
BVC is reset again from the BSS.
Before this patch cells were never freed and might accumulate over time.
They would only be reused if the bvci matched that of a previous cell.
Related: OS#4960
Change-Id: Ib874cbebcea58fa4bf15e1ff40fe11601573e531
This is only used for the imsi cache entries for now. Further uses will
be added in subsequent commits.
Related: OS#4472
Change-Id: I4a4b8c99eb97f6bb5387d0f26aecd861e07d9914
If an SGSN in a pool is down we expect the messages to instead be sent
to a different SGSN in the pool. That SGSN will not necessarily know
what to do with those messages, but it should (implicitly) detach that
UE so that it can reattach at the new SGSN. Otherwise UEs on a failed
SGSN would simply stop working as the messages would never be forwarded
anywhere.
Fixes: OS#4952
Change-Id: I3f794659866e1f31496a39ca631b3b042a60aa27
Previously gprs_ns2_vty_init() was called after handle_options(). This
caused config-ns* commands to be missing when calling
osmo-gbproxy --vty-ref-xml
which is used to generate the vty reference manual.
This commit moves argument handling until after all VTY commands have
been installed.
Change-Id: I0f779c16085a42b308925a676b144999106f2b63
The CellIdentifier IE of a BVC-RESET contains RA-ID and CID. We only
printed the forer, but not the latter. Let's fix that.
Change-Id: Ic8b26afe98e6fe11b130679201493f6bcbade0f4
When a BSS resets its BVC and reuses a BVCI with a differente cell id
the SGSN BVC still has the old cell information.
This results in the SGSN receiving a BVC reset for the old cell which in
turn leads to all sorts of issues (probably also with paging) and
conflicting information since the cell info is also present in the
UL-UNITDATA and this is just passed through from the BSS.
Instead of reusing the old BVC on the SGSN side free any existing and create
new ones.
Change-Id: Ia94090a0133340b7b284df6ec5b36546da698b37
osmo-gbproxy already provides a ctrl interface, we should be able to
change ctrl-related configuration.
Change-Id: I3f3aa46aa032c1bd0ec88163bb89701d2250f414
SGSN NSEs are static and should not be removed. Instead remove all
PtP-BVCs.
BVC0 can't be blocked and will be reset after the NSE becomes available
again. It might be cleaner to remove BVC0 on NS failure and create it
again, but that change is a bit more complicated.
Fixes ttcn3 test after commit f96cac5077 broke them.
Related: OS#4897
Change-Id: Ie0cef38e4423b672f5cba35ae7fc3eb2c4071d5a
When a complete NSE becomes unavailable gbproxy should notify the other
side (bss/sgsn).
The current code blocks every PtP-BVC (belonging to that BSS) on all SGSNs if
a BSS goes down.
The BSS-side should not be blocked unless no more SGSN connections are
present. We could also remove all BSS nse and wait for those to reconnect.
This is not yet implemented.
Related: OS#4897
Change-Id: I6354a190ec1090a35c27671c72dab9126d0ad794
bssgp_tx_status() is not aware of the MTU and cannot truncate the PDU if
needed. Use the newer bssgp2_enc_status() which supports truncating the
PDU.
Related: OS#4889
Depends: Ic39d918c56399ceb0431299ce938e3bf276f678a (libosmocore.git)
Change-Id: Id5ddb10385655b339b2a4f04651c1da09b3efb62
Prepare tracking the SDU from NS. Initialize with a conservative default.
The value is not yet updated, that will happen in a later patch.
Related: OS#4889
Depends: I5016b295db6185ec131d83089cf6c806e34ef1b6 (libosmocore.git)
Depends: I9bb82ead27366b7370c9ff968e03ca2113ec11f0 (libosmocore.git)
Change-Id: Ic1080abde942ec5a2ae7cdee0ffe716a2fbddb1e
Use the function provided by bssgp2 instead of setting up the ns2 prim
request ourself.
Related: OS#4889
Change-Id: I0b8926eb903ed972edb2ed7ba3edbb3d77889564
In some logging statements the function bssgp_rim_ri_name() is used
twice. This is wrong since _name() functions use an internal buffer,
which can not be used twice in the same logging statement, so for the
affected log statements the function bssgp_rim_ri_name_buf() must be
used.
Change-Id: I8b6254a269770ddc141325d67d143f2a8130c519
Related: SYS#5103
BSSGP RIM messages are routed from a source to a destination cell by a
RIM routing information IE. Add parsing for the routing information and
support for relaying RIM messages to the destination cell/PCU. If the
destination cell/PCU is not directly connected to osmo-gbproxy route the
rim message to the first connected SGSN.
Change-Id: Idd1ea46832e044f0ade15af32250f90517d848d8
Related: SYS#5103
The MSC-pooling chapter in OsmoBSC mentions that overlapping NRI ranges will
warn if configured though the VTY interface, but fail when started with
such a config.
The manual for OsmoGbProxy promises a similar behaviour, this patch implements
it.
Change-Id: Id3815ed8d1736ea3ba1e498b2bc3cf30b772551d