ctrl: subscriber-list-active: list only attached subscribers

I would have liked to add a regression test to verify this, but currently there
is no easy way to run CTRL tests and at the same time have access to the
osmo-msc in a way that simulates an attached subscriber.

Related: OS#2285
Change-Id: I003542b208ecf3713e9e67712d84ccb4c61af14e
diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c
index 7e445aa..4767ddd 100644
--- a/src/libmsc/ctrl_commands.c
+++ b/src/libmsc/ctrl_commands.c
@@ -68,6 +68,9 @@
 	cmd->reply = talloc_strdup(cmd, "");
 
 	llist_for_each_entry(vsub, &msc_ctrl_net->vlr->subscribers, list) {
+		/* Do not list subscribers that aren't successfully attached. */
+		if (!vsub->lu_complete)
+			continue;
 		cmd->reply = talloc_asprintf_append(cmd->reply, "%s,%s\n",
 						    vsub->imsi, vsub->msisdn);
 	}