Commit Graph

8 Commits

Author SHA1 Message Date
Jacob Erlbeck af792d6bb2 msc: Add net parameter to trans_alloc
The trans_alloc function still uses the subscr object to access the
network object.

This patch adds an explicit net parameter to this function and
removes the access to subscr to obtain it.

Sponsored-by: On-Waves ehf
2014-12-09 08:59:29 +01:00
Jacob Erlbeck 1e30a28e51 msc: Add and use gsm_subscriber_group
Currently every subcriber object directly refers to the gsm_network
which contains a flag shared by every related subscriber
(keep_subscr). This adds a dependency on gsm_network even if only the
function defined in gsm_subscriber_base.c are used.

This patch adds a new struct gsm_subscriber_group which contains the
keep_subscr flag and a back reference to the network object. The
latter is not dereferenced in gsm_subscriber_base.c, so it can safely
be set to NULL when only that part of the gsm_subscriber API is being
used. It also changes that API to use gsm_subscriber_group instead of
gsm_network parameters.

Since there are some places where a pointer to the gsm_network is
needed but where only a gsm_subscriber is available, a 'net' back
pointer is added to the group struct, too. Nevertheless subscr group
and network could be separated completely, but this is not the topic
of this commit.

Sponsored-by: On-Waves ehf
2014-12-05 14:59:02 +01:00
Jacob Erlbeck dae1f64ba6 msc: Don't use the subscriber to access the net object
Sponsored-by: On-Waves ehf
2014-12-05 14:58:41 +01:00
Jacob Erlbeck f07c605361 msc: Add net back pointer to gsm_trans
Currently the net pointer is obtained from trans->subscr->net. On the
other hand, the list gsm_trans object is managed by the net object.

This patch adds the back pointer to the structure and replaces all
trans->subscr->net by trans->net expressions. In trans_alloc() the
trans->net pointer is obtained from the subscr object.

Sponsored-by: On-Waves ehf
2014-12-05 14:56:35 +01:00
Holger Hans Peter Freyther 8effcb747d libmsc: Set the "trans->conn" to NULL to catch invalid usage
Make finding use-after-free more easy and set it to NULL.
2013-12-27 18:07:23 +01:00
Holger Hans Peter Freyther 405824c057 libmsc: Set trans->subscr = NULL after we release it
This is a cosmetic change and should happen to find use after free
of the subscriber.
2012-12-22 18:16:47 +01:00
Holger Hans Peter Freyther 70ae5d3000 nitb: Release the channel if there is nothing on it
This is more a work around and one still needs to implement a
proper dispatch on the opening of the connection. If there is no
operation left, no transaction and no silent call, close down the
channel.
2012-12-01 11:32:47 +01:00
Holger Hans Peter Freyther d447e99587 bsc: Move transaction.c from the libbsc to the libmsc
The BSC code does not use transactions, move it to the libmsc.
2011-04-18 17:31:40 +02:00