mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user