Commit Graph

2533 Commits

Author SHA1 Message Date
Harald Welte b87bc86006 [SGSN] SNDCP: more verbose defragmentation debugging 2010-07-01 20:29:20 +02:00
Harald Welte 8911cef81d [SGSN] Fix segfault when passing re-assembled SN-PDU to GMM
sgsn_rx_sndcp_ud_ind() can no longer make the assumption that msgb_bcid() is
valid, as this is only true for an un-fragmented SN-PDU.  So instead,
we now store the RAID in the SNDCP Entity and pass it as an explicit
argument to sgsn_rx_sndcp_ud_ind().
2010-07-01 19:56:19 +02:00
Harald Welte 951a12cf4e [SGSN] SNDCP: fix off-by-one error during defragmentation 2010-07-01 15:09:45 +02:00
Harald Welte 362aea0f4d [SGSN] SNDCP: Initialize defrag list header 2010-07-01 12:31:10 +02:00
Harald Welte fd29a1f6cc [SGSN] GMM: Complete value_string for GMM cause values 2010-07-01 12:26:59 +02:00
Harald Welte 65d96783df [SGSN] SNDCP: use llist_for_each_entry_safe() when cleaning frag queue 2010-07-01 12:19:02 +02:00
Harald Welte 875840c603 [SGSN] Fix TLLI (re)assignments
Once The TLLI (or P-TMSI of which it is derived) change has been
confirmed by the MS, we need to unassign the old TLLI but keep
the new TLLI  _without_ re-setting the LLC entity structure such
as VUsend /VUrecv counters.
2010-07-01 11:54:31 +02:00
Harald Welte 937a9ecfcd [SGSN] Fix segfault when doing PS PAGING
The 'bssgp_paging_info' contains a pointer to the P-TMSI, and not
the P-TMSI itself.  The reason is that it is an optional BSSGP IE.
2010-07-01 11:53:25 +02:00
Harald Welte f78a3b2a22 [SGSN] Add VTY interface for SNDCP 2010-07-01 10:57:44 +02:00
Holger Hans Peter Freyther cacbc73d5e osmo_bsc: Add option parsing, vty dummy
Add dummy files and option parsing for the Osmo BSC code.
2010-06-30 15:11:30 +08:00
Holger Hans Peter Freyther ab5135e36a bsc: Move meas_rep.c into the libbsc.c as it is used from bsc_vty.c 2010-06-30 15:11:30 +08:00
Holger Hans Peter Freyther 5ccab1020c osmo_bsc: Add empty osmo_bsc_main.c and hook it into the build 2010-06-30 15:11:29 +08:00
Holger Hans Peter Freyther ec4bfdc435 bsc_api: Move the API init into the main function.
The BSC API will not be used until the first iteration through
the event loop so it is safe to call it after the bootstrap.
2010-06-30 15:11:29 +08:00
Holger Hans Peter Freyther 2f4dbebb20 osmo-bsc: Start adding code for the osmo_bsc..
This adds the unix domain socket rf control protocol into
the new subdirectory.
2010-06-30 15:11:29 +08:00
Nico Golde 5950236b5e * Fix null ptr dereference and sms memleak in case the recipient of an sms sent via vty is not attached. Store the sms in the database in this case for later delivery.
The problem is that sms_from_text returns NULL in case the
subscriber is not attached which a) leaks memory of the
previously allocated sms and b) runs into a null ptr
dereference in _send_sms_str().

There may be a better solution than this but this is the
easiest way of noticing and taking action I could find
without changing return values of sms_from_text.
2010-06-30 09:10:04 +02:00
Harald Welte bd17b39fd2 [BSC] VTY: Fix parsing of uppercase hex digits 2010-06-30 09:01:35 +02:00
Harald Welte 43ef6483db [SGSN] BSSGP: Print TLLI as hex value like everwhere else 2010-06-30 09:01:35 +02:00
Holger Hans Peter Freyther d9c9f07c2c handover: lchan_free will only free the local resources.
lchan_free only free's the local resource of the BSC but
does not release the channel at the BTS. Use lchan_release
to properly release the channel. This code assumes that the
timeout happens after a CHAN ACT ACK/NACK otherwise we have
some problems. The comment indicates that this is the case.
2010-06-30 13:04:13 +08:00
Holger Hans Peter Freyther f2553a6c3a handover: Call bsc_handover_clear from gsm0808_clear
The bsc_handover_clear will release an in-progress handover
and free the lchana and the data associated with this handover
2010-06-30 13:02:08 +08:00
Holger Hans Peter Freyther 0610947f4c misc: Move handover_logic.c into the libbsc.a
We are implementing the intra BSC handover so we should have the
code in the BSC as well.
2010-06-30 12:59:20 +08:00
Holger Hans Peter Freyther 88519eaaef msc: Add includes to silence a compiler warning. 2010-06-30 12:59:20 +08:00
Holger Hans Peter Freyther e071ab70e9 handover: Attempt to use the same gsm_subscriber_conn for new/old channel
The transaction should not know on which lchan we are operating
as this can change due handover. Add untested code to share the
subscriber connection of the new and old lchan and move the pointer
in case of success/failure. Also on a clear command we will free
any resources allocated...

This code is not tested and needs to be debugged, but it should
have the right structure. I am going to fix a potential memleak
in the next commit.
2010-06-30 12:59:20 +08:00
Holger Hans Peter Freyther d06516557a bsc_api: Avoid use after free kind of error on the lchan. 2010-06-30 12:17:35 +08:00
Holger Hans Peter Freyther 2486663844 ussd: Release the MSC connection as fast as possible.. 2010-06-30 12:15:19 +08:00
Holger Hans Peter Freyther 0379c6d386 abis_rsl: Add full MA again until we are confident to remove it
The spec seems to say we do not need to include the full MA,
even for Phase1 phones but that is not so clear...
2010-06-30 12:06:20 +08:00
Holger Hans Peter Freyther e38bd6caa3 abis_rsl: Change code to generate Channel Identification
1.) memset the gsm48_chan_desc to avoid sending dummy data
2.) According to the GSM08.58 9.3.5 the Mobile Allocation
    shall be included but the empty (by setting the length
    to zero).
3.) use msgb_tlv_put and calculate the length via the l3h
    msgb_l3len and assign it.
2010-06-30 12:01:22 +08:00
Holger Hans Peter Freyther 06abe9f383 ussd.c: Make sure text is memset to zero..
Make the strstr fail fast, make sure the text is null terminated...
2010-06-30 11:59:30 +08:00
Holger Hans Peter Freyther 66efcbce65 gsm_subscriber_base: Take a ref on the subscriber to avoid use after free
On expired paging we might access a GSM Subscriber that has already
been deleted. To avoid this we will add a subscr_get/subscr_put for
the subscriber to the allocation and release path of the request.

Reported-by: Richard Zahoransky
2010-06-30 11:59:29 +08:00
Harald Welte 93d50e69d3 [BSC] RSL: CHAN ACT: Only include MA if TS is hopping 2010-06-29 17:53:45 +02:00
Harald Welte 8fc60f0eb5 [SGSN] Deactivate SNDCP entity on PDP CTX DEACT CONFIRM
Otherwise we will end up leaking memory in the SNDCP layer...
2010-06-28 22:21:57 +02:00
Harald Welte bd5c91276b [SGSN] MM: Properly communicate TLLI changes / unassignment to LLC 2010-06-28 22:18:53 +02:00
Harald Welte f7fef48e1b [SGSN] LLC: properly free LLC entities at TLLI unassignment 2010-06-28 22:18:26 +02:00
Harald Welte c0d59504b4 [SGSN] Deactivate all PDP contexts on GPRS DETACH 2010-06-28 19:11:41 +02:00
Harald Welte 376d5e521e [SGSN] Fix segfault ar PDP CTX DEACT time
We need to call rate_ctr_group_free() on the per-PDPctx-counters
2010-06-28 18:57:21 +02:00
Harald Welte a1d39a2a11 [BSC] fix off-by-one error in computing l2 pseudo-length in IMM ASS
@fingerprint:
This caused Motorole EZX phones (Neptune LTE chipset) to discard
all immediate assigns and thus be unable to perform location updating.
2010-06-28 18:41:27 +02:00
Harald Welte 0f43dbcfc6 [ipaccess-config] Better way to set/unset NVRAM attributes
there are now human-readable names so you can do something like

ipaccess-config -U dhcp-enabled -S static-ip -S static-gw 192.168.100.120

to unset DHCP and to set static IP and gateway attributes.
2010-06-28 15:52:56 +02:00
Harald Welte 0aef73efc4 [ipaccess-config] Enable setting of static IP address / netmask / gateway
However, the 'static IP address' NVRAM flags are not yet set correctly
2010-06-28 15:18:17 +02:00
Harald Welte 8c21c07a65 [ipaccess-config] use msgb to make use of various tlv put functions
This looks so much better than the *cur++ type code.

Also, we now terminate ipaccess-config once the NV flags or Unit ID have
been set, not just for the OML IP address.
2010-06-28 14:41:09 +02:00
Holger Hans Peter Freyther ed83286950 gsm_data.c: Reorder includes to put osmocore up 2010-06-28 18:20:22 +08:00
Holger Hans Peter Freyther 4049455d74 bsc_msc: Remove use_count from the subscriber connection
A channel will be released in case of
    * Errors via the clear_request callback...
    * no more transactions and operations are going on.

This means that if we do something without a transaction
the channel might be closed down right away. The bug fix
will be to create a transaction/operation.
2010-06-28 18:01:47 +08:00
Holger Hans Peter Freyther 2412a07965 bsc_api: Allocate the subscriber_connection dynamically
This is a big change to the way we use the subscriber
connection. From now on it is is dynamically allocated
and we will slowly move from a 1:1 lchan to conn to
having more than one lchan per connection.

This is the first commit, the subscr_con* methods will
move to gsm_data once the use_count is removed from the
connection, the freeing of the connection will also change.
2010-06-28 16:12:39 +08:00
Holger Hans Peter Freyther 94d625bfa0 Revert "bsc_api: Move debug context for subscriber into the bsc_api.c"
This is breaking the filtering for the Measurement Report case, revert
the patch for now.

This reverts commit 69e8f8285b.
2010-06-28 13:38:19 +08:00
Harald Welte 9d4cca7a0e [BSC] Enable the use of whitespaces in the subscriber name
This patch (originally by Luca Bertoncello) adds support for spaces
in the subscriber name when specified from the VTY.
2010-06-24 08:06:38 +02:00
Holger Hans Peter Freyther 2788b96bf4 gprs: Fix LOGP misuse and specify LOGL_NOTICE as region. 2010-06-23 09:48:25 +08:00
Holger Hans Peter Freyther f7a1c23e1d lchan: Document why lchan_reset is there... at least try to. 2010-06-22 12:26:35 +08:00
Holger Hans Peter Freyther 5ba05f4d26 abis_rsl: Send the IMMEDIATE Assignment after the Channel Ack.
The Channel Activate might be sent to a different TRX than the
Immediate Assignment. So we need to make sure that the channel
is activated before we send the immediate assignment for the RACH.

Another reason for that is according to GSM 08.58 we should take
the frame number from the activate and use it for the starting
time inside the immediate assignment message. We obviously do not
do this yet.

The code assumes that the BTS will either respond with a CHAN ACK
or a CHAN NACK if not the lchan will remain in the request state.
2010-06-22 12:26:35 +08:00
Nico Golde 4df2ad9ac6 [SMS] avoid mktime on NULL
gmtime(NULL) returns NULL at least in glibc and *can not* be used as
time(NULL). Since we compare two time_t values when checking the validity
period this can be replaced by time(NULL)
2010-06-21 13:51:28 +02:00
Holger Hans Peter Freyther c8bf3c178f misc: make the compiler happy...
The compiler treats uint8_t*[] and uint8_t* differently,
use the address of the first element and assign that.
2010-06-21 18:21:16 +08:00
laforge cfa4a01c8f [RSL] hopping: Set correct L2 pseudo-length during IMMediate ASSign
Thanks to Sylvain for the hint that lead to this fix.
2010-06-21 12:09:41 +02:00
Holger Hans Peter Freyther a69d923fd7 bsc_api: Use conn->bts directly... 2010-06-21 16:40:09 +08:00