logging: Only compare the subscr address

Move the "logging filter imsi IMSI" into the BTS/NITB code to
allow to set the gsm_subscriber and only compare it. This way
we simply compare the subscriber address and don't have to care
if the subscriber data is still valid.
diff --git a/openbsc/src/libcommon/debug.c b/openbsc/src/libcommon/debug.c
index b3685e6..ca7ff5d 100644
--- a/openbsc/src/libcommon/debug.c
+++ b/openbsc/src/libcommon/debug.c
@@ -177,7 +177,7 @@
 	const struct gprs_nsvc *bvc = ctx->ctx[GPRS_CTX_BVC];
 
 	if ((tar->filter_map & (1 << FLT_IMSI)) != 0
-	    && subscr && strcmp(subscr->imsi, tar->filter_data[FLT_IMSI]) == 0)
+	    && subscr && subscr == tar->filter_data[FLT_IMSI])
 		return 1;
 
 	/* Filter on the NS Virtual Connection */
@@ -199,14 +199,18 @@
 	.num_cat = ARRAY_SIZE(default_categories),
 };
 
-void log_set_imsi_filter(struct log_target *target, const char *imsi)
+void log_set_imsi_filter(struct log_target *target, struct gsm_subscriber *subscr)
 {
-	if (imsi) {
-		target->filter_map |= (1 << FLT_IMSI);
-		target->filter_data[FLT_IMSI] = talloc_strdup(target, imsi);
-	} else if (target->filter_data[FLT_IMSI]) {
-		target->filter_map &= ~(1 << FLT_IMSI);
-		talloc_free(target->filter_data[FLT_IMSI]);
+	/* free the old data */
+	if (target->filter_data[FLT_IMSI]) {
+		subscr_put(target->filter_data[FLT_IMSI]);
 		target->filter_data[FLT_IMSI] = NULL;
 	}
+
+	if (subscr) {
+		target->filter_map |= (1 << FLT_IMSI);
+		target->filter_data[FLT_IMSI] = subscr_get(subscr);
+	} else {
+		target->filter_map &= ~(1 << FLT_IMSI);
+	}
 }