On Fri, Jun 28, 2013 at 04:52:28PM +0200, Harald Welte wrote:
The existing libgb API should cater for that. You can very well just
call gprs_ns_instantiate() and gprs_ns_vty_init() at PCU startup time,
but call gprs_ns_nsip_listen() and gprs_ns_nsip_connect() at the time
you receive the configuration from the BTS via the PCU_IF_MSG_INFO_IND.
Wouldn't that solve the problem?
Exactly.
Maybe I'm not understanding the problem yet,
sorry.
the "problem" comes from the fact that in case the "BTS" exits, the
next
time the BTS restarts it might gets different IP/PORT settings from
the BSC. So what was/is missing is a "gprs_ns_nsip_shutdown" which
will close the old socket and the PCU should look into destroying the
NSVC that got allocated for the old remote.
I don't know how to phrase it but I mean it nicely. Both Fairwaves
and sysmocom intend to use the PCU commercially. This means when we
wrote software we should avoid races or at least document them in a
TODO file. Because no matter how small the race, we will eventually
lose it. And the cost of understanding what went wrong is certainly
a lot higher than doing the right thing from the beginning.
I am attaching two diffs as a proposal (not even compile tested), they
should avoid the race condition.
cheers
holger
--
- Holger Freyther <hfreyther(a)sysmocom.de>
http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Schivelbeiner Str. 5
* 10439 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Directors: Holger Freyther, Harald Welte