mtp: Assign a name to linkset, use this name in the log messages
diff --git a/include/mtp_data.h b/include/mtp_data.h
index 20b5e5e..0e35ab5 100644
--- a/include/mtp_data.h
+++ b/include/mtp_data.h
@@ -45,6 +45,8 @@
 	int ni;
 	int spare;
 
+	const char *name;
+
 	/* internal state */
 	/* the MTP1 link is up */
 	int available;
diff --git a/src/links.c b/src/links.c
index 3977daf..0b22713 100644
--- a/src/links.c
+++ b/src/links.c
@@ -99,6 +99,7 @@
 	struct mtp_udp_link *lnk;
 
 	bsc->link_set = mtp_link_set_alloc();
+	bsc->link_set->name = talloc_strdup(bsc->link_set, "MTP");
 	bsc->link_set->dpc = bsc->dpc;
 	bsc->link_set->opc = bsc->opc;
 	bsc->link_set->sccp_opc = bsc->sccp_opc > -1 ? bsc->sccp_opc : bsc->opc;
@@ -145,7 +146,9 @@
 		bsc->start_timer.cb = start_rest;
 		bsc->start_timer.data = &bsc;
 		bsc_schedule_timer(&bsc->start_timer, lnk->reset_timeout, 0);
-		LOGP(DMSC, LOGL_NOTICE, "Making sure SLTM will timeout.\n");
+		LOGP(DMSC, LOGL_NOTICE,
+		     "Making sure SLTM will timeout on %s/%d\n",
+		      lnk->base.set->name, lnk->base.link_no);
 	}
 
 	return 0;
diff --git a/src/main_stp.c b/src/main_stp.c
index 6e080b5..45a89aa 100644
--- a/src/main_stp.c
+++ b/src/main_stp.c
@@ -253,6 +253,7 @@
 	bsc.m2ua_set->ni = 3;
 	bsc.m2ua_set->bsc = &bsc;
 	bsc.m2ua_set->pcap_fd = bsc.pcap_fd;
+	bsc.m2ua_set->name = talloc_strdup(bsc.m2ua_set, "M2UA");
 
 	/* for both links we want to have all isup messages */
 	bsc.m2ua_set->pass_all_isup = 1;
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c
index 00debb6..3a59b4f 100644
--- a/src/mtp_layer3.c
+++ b/src/mtp_layer3.c
@@ -297,7 +297,7 @@
 
 	set->linkset_up = 1;
 	LOGP(DINP, LOGL_NOTICE,
-	     "The linkset %p is considered running.\n", set);
+	     "The linkset %s is considered running.\n", set->name);
 	return 0;
 }
 
@@ -320,9 +320,9 @@
 	case MTP_TRF_RESTR_MSG_GRP:
 		switch (cmn->h1) {
 		case MTP_RESTR_MSG_ALLWED:
-			LOGP(DINP, LOGL_INFO, "Received Restart Allowed. SST could be next: %p\n", link);
+			LOGP(DINP, LOGL_INFO, "Received Restart Allowed. SST could be next: %s\n", link->name);
 			link->sccp_up = 1;
-			LOGP(DINP, LOGL_INFO, "SCCP traffic allowed. %p\n", link);
+			LOGP(DINP, LOGL_INFO, "SCCP traffic allowed. %s\n", link->name);
 			return 0;
 			break;
 		}
@@ -466,7 +466,8 @@
 		return -1;
 
 	if (!link->set->running) {
-		LOGP(DINP, LOGL_ERROR, "Link is not running. Call mtp_link_reset first: %p\n", link);
+		LOGP(DINP, LOGL_ERROR, "Link is not running. Call mtp_link_reset first: %s/%d\n",
+		     link->set->name, link->link_no);
 		return -1;
 	}
 
diff --git a/src/mtp_link.c b/src/mtp_link.c
index 7133718..6c7b3e1 100644
--- a/src/mtp_link.c
+++ b/src/mtp_link.c
@@ -75,12 +75,16 @@
 	rate_ctr_inc(&link->ctrg->ctr[MTP_LNK_SLTM_TOUT]);
 
 	if (link->slta_misses == 0) {
-		LOGP(DINP, LOGL_ERROR, "No SLTM response. Retrying. Link: %p\n", link);
+		LOGP(DINP, LOGL_ERROR,
+		     "No SLTM response. Retrying. Link: %s/%d\n",
+		     link->set->name, link->link_no);
 		++link->slta_misses;
 		mtp_send_sltm(link);
 		bsc_schedule_timer(&link->t1_timer, MTP_T1);
 	} else {
-		LOGP(DINP, LOGL_ERROR, "Two missing SLTAs. Restart link: %p\n", link);
+		LOGP(DINP, LOGL_ERROR,
+		     "Two missing SLTAs. Restart link: %s/%d\n",
+		     link->set->name, link->link_no);
 		bsc_del_timer(&link->t2_timer);
 		mtp_link_failure(link);
 	}
@@ -91,7 +95,9 @@
 	struct mtp_link *link = (struct mtp_link *) _link;
 
 	if (!link->set->running) {
-		LOGP(DINP, LOGL_INFO, "The linkset is not active. Stopping SLTM now. %p\n", link);
+		LOGP(DINP, LOGL_INFO,
+		     "The linkset is not active. Stopping SLTM now. %s/%d\n",
+		     link->set->name, link->link_no);
 		return;
 	}
 
@@ -163,7 +169,8 @@
 
 void mtp_link_failure(struct mtp_link *link)
 {
-	LOGP(DINP, LOGL_ERROR, "Link has failed. Resetting it: 0x%p\n", link);
+	LOGP(DINP, LOGL_ERROR, "Link has failed. Resetting it: %s/%d\n",
+	     link->set->name, link->link_no);
 	rate_ctr_inc(&link->ctrg->ctr[MTP_LNK_ERROR]);
 	link->reset(link);
 }