Compare commits

...

4 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther
2727909dba Make a release with the bugfix of the bugfix 2010-03-24 11:25:13 +01:00
Holger Hans Peter Freyther
ad9856ec15 ipa: Fix the previous patch and initialize the fds to -1
The code in 354ef81d80 checked
for fd >= 0 but on startup the struct is memset to 0 so this
test is true. Initialize the fds to -1 to make the code work
and be able to handle all ranges of the fd.
2010-03-24 11:23:39 +01:00
Holger Hans Peter Freyther
9d53a8ad2a Release 0.3.3 with the proposed BFD fix. 2010-03-24 04:14:26 +01:00
Holger Hans Peter Freyther
058956e8ee 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.
2010-03-24 04:02:55 +01:00
2 changed files with 14 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT
AM_INIT_AUTOMAKE(openbsc, 0.3.2onwaves)
AM_INIT_AUTOMAKE(openbsc, 0.3.4onwaves)
dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

View File

@@ -242,6 +242,14 @@ 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);
newbfd->fd = -1;
}
/* get rid of our old temporary bfd */
memcpy(newbfd, bfd, sizeof(*newbfd));
newbfd->priv_nr = 2+trx_id;
@@ -484,6 +492,7 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what)
{
int ret;
int idx = 0;
int i;
struct e1inp_line *line;
struct e1inp_ts *e1i_ts;
struct bsc_fd *bfd;
@@ -510,6 +519,10 @@ static int listen_fd_cb(struct bsc_fd *listen_bfd, unsigned int what)
/* create virrtual E1 timeslots for signalling */
e1inp_ts_config(&line->ts[1-1], line, E1INP_TS_TYPE_SIGN);
/* initialize the fds */
for (i = 0; i < ARRAY_SIZE(line->ts); ++i)
line->ts[i].driver.ipaccess.fd.fd = -1;
e1i_ts = &line->ts[idx];
bfd = &e1i_ts->driver.ipaccess.fd;