diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-24 04:02:55 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-03-24 04:44:50 +0100 |
commit | 354ef81d8062510765b7280023b3f4ef98d0613a (patch) | |
tree | 5ac838c575e5d8bee1c5bcbc9f9eb1588e12c5ae /openbsc | |
parent | 7f0f8b92ce35c59d3d61f3603272724f55109b48 (diff) |
ipaccess: Handle the case of replacing RSL connections
Fix a infinite loop when establishing a new RSL connection and the
BSC is identifying itself with a unit id of an already established
RSL connection. The infinite loops happens because we are corrupting
the the linuxlist inside the bsc_fd when registering the bfd twice.
Due the lack of proper authentication favor the new RSL connection
as the real one and close the previous one.
Diffstat (limited to 'openbsc')
-rw-r--r-- | openbsc/src/input/ipaccess.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/input/ipaccess.c b/openbsc/src/input/ipaccess.c index 943a5e88d..71a3bde0a 100644 --- a/openbsc/src/input/ipaccess.c +++ b/openbsc/src/input/ipaccess.c @@ -247,6 +247,13 @@ static int ipaccess_rcvmsg(struct e1inp_line *line, struct msgb *msg, trx->rsl_link = e1inp_sign_link_create(e1i_ts, E1INP_SIGN_RSL, trx, trx->rsl_tei, 0); + + if (newbfd->fd >= 0) { + LOGP(DINP, LOGL_ERROR, "BTS is still registered. Closing old connection.\n"); + bsc_unregister_fd(newbfd); + close(newbfd->fd); + } + /* get rid of our old temporary bfd */ memcpy(newbfd, bfd, sizeof(*newbfd)); newbfd->priv_nr = 2+trx_id; |