aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb
AgeCommit message (Collapse)AuthorFilesLines
2021-01-18gprs_ns2_vc_fsm: fix spaces and remove wrong commentAlexander Couzens1-3/+2
Change-Id: I52799d8ce8244fae7512a6e14a3cf2408a218c2d
2021-01-18gprs_ns2: flag then NSE as dead in nse_free()Alexander Couzens1-0/+1
The transfer cap call in ns2_prim_status_ind() asserts if NSE is in an invalid state (nse is either alive or has NSVCS). Change-Id: I535b3e5dd7240d19dd685652173775b250f5cc2d
2021-01-18gprs_ns2_sns: clear local and remote entries when SNS failedAlexander Couzens1-0/+16
The local and remote entries should be cleared on SNS Size. Further it can be cleared when SNS failed (e.g. all NSVC become dead) so VTY doesn't show old entries before entering SNS Size. Related: OS#4949 Change-Id: Ie4db81acdd5f8ddf1a1f5dc7645d1144545d9c73
2021-01-18gprs_ns2: when calling nsvc_force_unconf for a dynamic NSE drop the NSE.Alexander Couzens1-1/+3
The vty command is used for test cases to reset NSE state. So dynamic NSE shouldn't present. Related: SYS#5208 Change-Id: I0a4f35c974c8c3b79c48f2f56170722c95254332
2021-01-17gprs_ns2_vc: answer UNBLOCK on unblocked nsvcAlexander Couzens1-1/+5
48.016 7.2: says an UNBLOCK pdu should be answered with UNBLOCK_ACK on already unblocked NSVC Related: SYS#5208 Change-Id: Ic92e99b2607d1e54ecb4668667065502a55a2ce0
2021-01-17gprs_ns2: check if persistent nsei or nsvc exists when creating dynamic NSEAlexander Couzens1-4/+34
When receiving a NS Reset over an unknown NSVC the NS code would create a dynamic NSE. If the NSEI or NSVCI is already configured to a persistant NSE/NSVC the packet should be ignored. Related: SYS#5208 Change-Id: I855911e7d364f2e5b08ea05857747aa63fcf1cd3
2021-01-17ns2: Fix memory leak in IP-SNSDaniel Willmann1-2/+2
Don't allocate msg twice - it's not nice. Change-Id: I3fa0076eb480a7bcadb74cc86760dc29b77ac600 Related: OS#4874
2021-01-17Refactor ns2_nsvc_create_ip*Daniel Willmann1-30/+19
Move code common in ipv4/6 into a separate function and call that function. Change-Id: I076d53bee2e67e1cb3ad6ee5cd05c63ebe3359fb Related: OS#4948
2021-01-16ns2: Add sanity checkDaniel Willmann1-0/+3
Prevent memory corruption or segfaults by asserting that NSE and bind link layer match. A mismatch should never happen and might cause the bind to access invalid memory when sending because nsvc->priv doesn't match what it expects. Change-Id: I7ca4cd1c5dac8b5e44ffc4825b9373b2d04911ab Related: OS#4948
2021-01-14NS2: Fix bind selection of SNS NSVCsDaniel Willmann1-0/+8
The SNS code ignored the link type of the bind and just bound to every bind it could find. This resulted in a segfault when an SNS NSVC tries to send its UDP messages though frame relay. Fixes: OS#4948 Change-Id: Ibb832a39876362d094cce635192f7b4f84dc2b10
2021-01-11gprs_bssgp: abuse gsm48_encode_ra() to encode TACVadim Yanitskiy1-1/+2
Both LAC and TAC take 2 octets and follow MCC/MNC fields on the wire. We abuse gsm48_encode_ra() for encoding of MCC/MNC, but it can also be abused to encode TAC in bssgp_create_rim_ri(). There is no need to encode '0000'O and then override it with osmo_store16be(). Change-Id: I986552aa52cf38b1c5290d2e5cd3ff2d1c36a4e5
2021-01-07bssgp_bvc_fsm: Handle block request from application correctlyDaniel Willmann1-1/+4
This is no event from an incoming message so rx is NULL, and we can't send a status PDU. Also blocking the signalling BVC is not allowed (unblocking it is already forbidden). Change-Id: I3e384b71d57e939efc1596ac1d92380ed5eb916d Fixes: CID#215716
2021-01-07ns2_frgre: Fix missing break statement for recv from IPV6Daniel Willmann1-0/+1
Change-Id: I549277483fee55f390e0b5ae1dafec6f2d68eae7 Fixes: CID#215836
2021-01-05bssgp: Add SUSPEND_NACK to osmo_pdef_bssgpDaniel Willmann1-0/+2
Change-Id: Ic996a343215ad32e3f301712411006e5d41f9084 Related: SYS#4865
2021-01-05gprs_bssgp: fix uninitialized struct fields in bssgp_create_rim_ri()Vadim Yanitskiy1-3/+6
Change-Id: Ifc3dda1fe5e9743072751dbb14c2d973388cb3b2 Fixes: CID#215836
2021-01-05gprs_ns2_fr: fix resource leaks due to early return in set_ifupdown()Vadim Yanitskiy1-2/+6
Change-Id: Ie52bf8ac6d62e7f2d760294bf2fe90119cc96b4b Related: CID#215869
2021-01-05gprs_ns2_sns: always check rc of osmo_sockaddr_str_from_sockaddr()Vadim Yanitskiy1-1/+3
Writing a configuration that will be rejected by the VTY parser is not the best solution, but still better than printing values from previous iterations or the stack garbage. In any case, this is unlikely to happen, just making Coverity happy. Change-Id: I26644fe544c82c90767ec1a9709918474bd1be53 Fixes: CID#215852
2021-01-05gprs_ns2: set transfer cap in NS Status primitiveAlexander Couzens6-1/+84
Related: SYS#5153 OS#4835 Change-Id: Ia1046db9e0d50855bff9de670b612ffc57af9995
2021-01-04gprs_bssgp: add handling for BSSGP RIM primitivesPhilipp Maier1-0/+42
Receive and forward RIM messages to bssgp_prim_cb() Change-Id: Idfd0a65872a2cc6089885afd8d31b0b029d85d47 Related: SYS#5103
2021-01-01gprs_ns2: use zero initialized memory for vty_bindsAlexander Couzens1-1/+1
Change-Id: I5635d98c52948fddcc375e1be9b1cd04aa32bc3c
2020-12-29gprs_ns2: fr: check the device state before changing stateAlexander Couzens1-0/+7
Reduce the required capabilities if the device is already set up. Change-Id: I72eb2567078758694c648a493324b212461ee735
2020-12-27gprs_ns2_fr: setup_device: allow to setup a new dahdi deviceAlexander Couzens1-4/+6
When a dahdi device hasn't been set up yet, ioctl IF_GET_PROTO fails with invalid argument. Also fix the device check to skip ioctl's if the device is also in the correct state. Change-Id: I398d056546e35465a2944e1b4a86a8c93b3e5f7a
2020-12-26gprs_ns2: rework frame relay load distribution functionAlexander Couzens2-23/+18
For frame relay the traffic will be even distributed across all NS-VCs. Do not differentiate between signalling and data traffic. Change-Id: I6c060941db335a7a6a555ac8d1b9269fa8fb2023
2020-12-23frame_relay: link_alloc: move log message to the endAlexander Couzens1-3/+2
The link->name is still not set resulting in logging a (null) Change-Id: I67cd4bce8238340e6ecb8d04a9a39c8b8d7d63e7
2020-12-23frame_relay: prevent null pointer exception when talloc failsAlexander Couzens1-0/+2
Change-Id: Ib39682ad0c7f30c97303b3d0bb6240fddd23ec0b
2020-12-23gprs_ns2: fix force-unconfigured for IP-SNS NSEAlexander Couzens2-4/+12
The IP-SNS need to do a reselection of the IP-SNS remote for testing. Freeing all nsvc will force this. Change-Id: I367c215a830c02eae2a470cba314828b5e0fb5c9
2020-12-23gprs_ns2: don't start unconfigured fsm via FORCE_UNCONFIGUREDAlexander Couzens1-4/+6
IP-SNS NSVC are unconfigured and not started when the IP-SNS is doing the SNS configuration. If those NSVC would be started it would result in unsolicitated NS-Alive PDUs. Change-Id: Ifec7288dbe71f10109e8b5c3849bf8f23ac7b557
2020-12-23gprs_ns2: sns: add log message when size/config retries exhaustedAlexander Couzens1-4/+8
Change-Id: I5f7c04b364807418f5ba22132fc889b46d66aed0
2020-12-23gprs_ns2: sns: don't send duplicated packets on retriesAlexander Couzens1-4/+4
When all retries are exhausted it should change the state and not send out a packet. Change-Id: Ie33df4a12298882bc46633200486dc34c6e34d8e
2020-12-23gprs_ns2: sns: correct log message when no nsvcs availableAlexander Couzens1-3/+6
The log message should only shown if a reselection will be triggered. Change-Id: I96b280a927aba6ac09ce88aedfcf469243c4dffe
2020-12-22gprs_ns2: add new vty2Alexander Couzens6-1/+1669
Change-Id: I163279cf57e84198dc8c53e1c109f5a9474670e9
2020-12-21gprs_ns2_fr: Use OSMO_STRLCPY_ARRAY() where possibleHarald Welte1-2/+2
Change-Id: I8ce461ecc36a81a4221336e82a36a69f49f89a0a
2020-12-21gprs_ns2_fr: Avoid stringop-truncation warningHarald Welte1-1/+1
gprs_ns2_fr.c:448:2: error: ‘strncpy’ specified bound 16 equals destination size [-Werror=stringop-truncation] 448 | strncpy(req.ifr_name, netif, IFNAMSIZ); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Ied9fd1bea091075fad266258da39e674d10d4dcb
2020-12-20gprs_ns2: fr: setup the device to correct FR/LMI settingsAlexander Couzens1-4/+110
A hdlc can be used in different modes. Also a FR device can be used with lmi and certain settings as without it. ns2 will use FR with no lmi in the kernel. Related: SYS#5169 Change-Id: I04786d2b864860b08c2e1afdb199470f4b80cc3b
2020-12-20gprs_ns2: fr: implement a write queueAlexander Couzens1-29/+19
Related: SYS#5228 Change-Id: Id6eba04d5fb744f791b333c168729bbbd28cabd9
2020-12-20gprs_ns2: don't pass the return code of reject_status_msgAlexander Couzens1-10/+5
When reject_stats_msg() fails the code can't do anything about it. Stick to the original failure code and log it Change-Id: I105363957e59c41a68835b7a9830c048dba73e93
2020-12-20gprs_ns2: improve handling of TLV errors on new nsvcsAlexander Couzens1-8/+20
The specification says the PDU should be ignored if the PDU type is unknown. Change-Id: I2992d06b37ed122b7ff315d4852e86acc936800b
2020-12-18fix strncpy bug in gprs_ns2_fr_bind()Neels Hofmeyr1-1/+1
This use of strncpy() fails to account for the terminating nul character. Use OSMO_STRLCPY_ARRAY() instead. (Interestingly my compiler doesn't complain about this one, though it failed on another similar use of strncpy().) Change-Id: Id53e940c7a39ab154966548f4173a179c5bc9151
2020-12-18gprs_ns2_fr.c: compiler error: replace strncpy() with OSMO_STRLCPY_ARRAY()Neels Hofmeyr1-2/+1
My gcc (Debian 8.3.0-6) 8.3.0 refuses to build this strncpy() use: it issues the buffer length as n and thus potentially fails to account for the terminating nul. The line after that fixes the problem, so it's not an actual bug. Anyway, we have a policy to never use strncpy(), and have osmo_strlcpy() and OSMO_STRLCPY_ARRAY() for this. This strncpy() was introduced last month during first addition of gprs_ns2_fr.c: commit 841817ec52186029ca01f0c082ed84f2dc5ffcc5 ns2: add support for frame relay Change-Id Id3b49f93d33c271f77cd9c9db03cde6b727a4d30 Change-Id: I494a6fb7ccd7938a39e8956f73ec4282da38d7fb
2020-12-18gprs_ns2: fr: fix crash when frame relay interface doesn't existsAlexander Couzens1-2/+2
When a frame relay interface doesn't exist gprs_ns2_fr_bind() would detect this but still return a success. Change-Id: I815b6ef5c3df780ac94461a05975a2b70898b01e
2020-12-16gprs_bssgp: add IE parser/generator for RIM Routing InformationPhilipp Maier2-0/+89
The RIM Routing Information IE (see also 3GPP TS 48.018, section 11.3.70) is used to control the flow of BSSGP rim messages at the SGSN. Change-Id: I6f88a9aeeb50a612d32e9efd23040c9740bc4f11 Related: SYS#5103
2020-12-16gprs_ns2_vty: udp: fixup dialect changesAlexander Couzens1-2/+6
Only accept receiving ipaccess style messages when use-reset-block is selected. If use-reset-block is disabled allow static NSVCs. Change-Id: Ia787528b1a6fac6bf1570c21643ef6cd8c209108
2020-12-16gors_ns2_vty: Fix saving of new NS2 timersHarald Welte1-0/+2
In I00e9023a6e7adc6ad48f4016fcaef189ac8b353e we introduced two new timers, but failed to add the related value_string[] entries. This caused the VTY code to save something like timer unknown 0x8 3 timer unknown 0x9 3 which fails to parse on re-start. Change-Id: If5cfdf1ef68d98933985406d0ac071a0a1185646
2020-12-16Fix VTY syntax for newly-introduced NS2 timersHarald Welte1-1/+1
In I00e9023a6e7adc6ad48f4016fcaef189ac8b353e we introduced two new "timers": Number of retries for SNS-CONFIG and for SNS-SIZE. Yet, the VTY syntax only added one string (tsns-prov-retires), probably dating back to an earlier version. Change-Id: I25fa579c7d68a8e4cb1175ae2245f009ab40fda7
2020-12-15gprs_ns2: on ns2_create_vc parse the tlv before using itAlexander Couzens1-9/+9
reject_status_msg require a parsed tlv. Otherwise an uninitialized tlv is passed. Change-Id: I82cab518966b8b49c3522ff5f7b6f82d1027a526
2020-12-15gprs_ns2: add gprs_ns2_fr_bind_role() to retrieve the fr roleAlexander Couzens1-0/+15
Change-Id: I277b805e588ba68536789b4a64a428ea0b31728a
2020-12-15gprs_ns2: make nsvc argument constAlexander Couzens1-1/+1
The nsvc isn't change. It can be const Change-Id: Ie5052f02781d7fdc639456c6f02515a927cee1f3
2020-12-15gprs_ns2_sns: introduce SNS Size/Config retriesAlexander Couzens3-5/+19
According to 3GPP Size and Config procedure can have retries in case the timeout of the procedure runs out. Change-Id: I00e9023a6e7adc6ad48f4016fcaef189ac8b353e
2020-12-15gprs_ns2_sns: use different binds for the initial connectionAlexander Couzens1-2/+13
In case the first bind is not working the SNS would never build a succesful connection to the SGSN. Iterate over all binds by using an offset. Instead of tracking the binds use an offset instead of a direct pointer. This might result in skipping the order of the next bind. Change-Id: I4a0a0608dac6ad8b5769ada2a14ca23f61eb0bcb
2020-12-15gprs_ns2_sns: rework IP-SNS initial remoteAlexander Couzens5-187/+358
The IP-SNS requires at least one initial remote address of the SGSN. However it should be multiple initial remote address instead of a single in case the interface might fail. Rework the SNS to support multiple initial remote addresses. Change-Id: I71cdbfb53e361e6112fed5e2712236d797ef3ab2