server_conn_fsm_alloc(): add explicit talloc context argument

The rspro_server_conn might be a static member of a different struct
and hence not suitable as a talloc context.

Change-Id: I9fd78d558f791d452f2a5279f1af13fd596c1cd6
diff --git a/src/client.h b/src/client.h
index 7a3c476..d85e647 100644
--- a/src/client.h
+++ b/src/client.h
@@ -37,6 +37,7 @@
 	uint16_t server_port;
 };
 
+int server_conn_fsm_alloc(void *ctx, struct rspro_server_conn *srvc);
 extern struct osmo_fsm remsim_client_server_fsm;
 
 /* main.c */
diff --git a/src/remsim_client_fsm.c b/src/remsim_client_fsm.c
index 84f9f4f..8711934 100644
--- a/src/remsim_client_fsm.c
+++ b/src/remsim_client_fsm.c
@@ -302,7 +302,7 @@
 	struct rspro_server_conn *srvc = (struct rspro_server_conn *) fi->priv;
 	int rc;
 
-	srvc->conn = ipa_client_conn_create(srvc, NULL, 0, srvc->server_host, srvc->server_port,
+	srvc->conn = ipa_client_conn_create(fi, NULL, 0, srvc->server_host, srvc->server_port,
 						srvc_updown_cb, srvc_read_cb, NULL, srvc);
 	if (!srvc->conn) {
 		fprintf(stderr, "Unable to create socket: %s\n", strerror(errno));
@@ -450,11 +450,11 @@
 	.event_names = server_conn_fsm_event_names,
 };
 
-int server_conn_fsm_alloc(struct rspro_server_conn *srvc)
+int server_conn_fsm_alloc(void *ctx, struct rspro_server_conn *srvc)
 {
 	struct osmo_fsm_inst *fi;
 
-	fi = osmo_fsm_inst_alloc(&remsim_client_server_fsm, srvc, srvc, LOGL_DEBUG, "server");
+	fi = osmo_fsm_inst_alloc(&remsim_client_server_fsm, ctx, srvc, LOGL_DEBUG, "server");
 	if (!fi)
 		return -1;