bsc: Select a MSC in a round-robin fashion
Select a MSC, add it to the back of the list after we have
selected it.
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
index 1410cc6..6b7256b 100644
--- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
+++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c
@@ -187,22 +187,19 @@
return 0;
}
-int bsc_create_new_connection(struct gsm_subscriber_connection *conn)
+int bsc_create_new_connection(struct gsm_subscriber_connection *conn,
+ struct osmo_msc_data *msc)
{
struct gsm_network *net;
- struct osmo_msc_data *msc;
struct osmo_bsc_sccp_con *bsc_con;
struct sccp_connection *sccp;
net = conn->bts->network;
- msc = osmo_msc_data_find(net, 0);
- if (!msc) {
- LOGP(DMSC, LOGL_ERROR, "Failed to select a MSC.\n");
- return -1;
- }
+ /* This should not trigger */
if (!msc->msc_con->is_authenticated) {
- LOGP(DMSC, LOGL_ERROR, "Not connected to a MSC. Not forwarding data.\n");
+ LOGP(DMSC, LOGL_ERROR,
+ "How did this happen? MSC is not connected. Dropping.\n");
return -1;
}