Index: uspace/srv/net/inetsrv/inet_link.c
===================================================================
--- uspace/srv/net/inetsrv/inet_link.c	(revision b8b1adb1dbe8315a5defb4f8442681f374111952)
+++ uspace/srv/net/inetsrv/inet_link.c	(revision 7af0cc5a018d0110bf2c694b3d163d45aa8b2725)
@@ -55,5 +55,4 @@
 static uint16_t ip_ident = 0;
 
-static int inet_link_open(service_id_t);
 static int inet_iplink_recv(iplink_t *, iplink_recv_sdu_t *, uint16_t);
 
@@ -62,6 +61,6 @@
 };
 
-static LIST_INITIALIZE(inet_link_list);
-static FIBRIL_MUTEX_INITIALIZE(inet_discovery_lock);
+static LIST_INITIALIZE(inet_links);
+static FIBRIL_MUTEX_INITIALIZE(inet_links_lock);
 
 static addr128_t link_local_node_ip =
@@ -113,51 +112,4 @@
 }
 
-static int inet_link_check_new(void)
-{
-	bool already_known;
-	category_id_t iplink_cat;
-	service_id_t *svcs;
-	size_t count, i;
-	int rc;
-
-	fibril_mutex_lock(&inet_discovery_lock);
-
-	rc = loc_category_get_id("iplink", &iplink_cat, IPC_FLAG_BLOCKING);
-	if (rc != EOK) {
-		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed resolving category 'iplink'.");
-		fibril_mutex_unlock(&inet_discovery_lock);
-		return ENOENT;
-	}
-
-	rc = loc_category_get_svcs(iplink_cat, &svcs, &count);
-	if (rc != EOK) {
-		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed getting list of IP links.");
-		fibril_mutex_unlock(&inet_discovery_lock);
-		return EIO;
-	}
-
-	for (i = 0; i < count; i++) {
-		already_known = false;
-
-		list_foreach(inet_link_list, link_list, inet_link_t, ilink) {
-			if (ilink->svc_id == svcs[i]) {
-				already_known = true;
-				break;
-			}
-		}
-
-		if (!already_known) {
-			log_msg(LOG_DEFAULT, LVL_DEBUG, "Found IP link '%lu'",
-			    (unsigned long) svcs[i]);
-			rc = inet_link_open(svcs[i]);
-			if (rc != EOK)
-				log_msg(LOG_DEFAULT, LVL_ERROR, "Could not open IP link.");
-		}
-	}
-
-	fibril_mutex_unlock(&inet_discovery_lock);
-	return EOK;
-}
-
 static inet_link_t *inet_link_new(void)
 {
@@ -183,5 +135,5 @@
 }
 
-static int inet_link_open(service_id_t sid)
+int inet_link_open(service_id_t sid)
 {
 	inet_link_t *ilink;
@@ -231,5 +183,5 @@
 
 	log_msg(LOG_DEFAULT, LVL_DEBUG, "Opened IP link '%s'", ilink->svc_name);
-	list_append(&ilink->link_list, &inet_link_list);
+	list_append(&ilink->link_list, &inet_links);
 
 	inet_addrobj_t *addr = NULL;
@@ -309,23 +261,4 @@
 }
 
-static void inet_link_cat_change_cb(void)
-{
-	(void) inet_link_check_new();
-}
-
-int inet_link_discovery_start(void)
-{
-	int rc;
-
-	rc = loc_register_cat_change_cb(inet_link_cat_change_cb);
-	if (rc != EOK) {
-		log_msg(LOG_DEFAULT, LVL_ERROR, "Failed registering callback for IP link "
-		    "discovery (%d).", rc);
-		return rc;
-	}
-
-	return inet_link_check_new();
-}
-
 /** Send IPv4 datagram over Internet link
  *
@@ -480,14 +413,14 @@
 inet_link_t *inet_link_get_by_id(sysarg_t link_id)
 {
-	fibril_mutex_lock(&inet_discovery_lock);
-
-	list_foreach(inet_link_list, link_list, inet_link_t, ilink) {
+	fibril_mutex_lock(&inet_links_lock);
+
+	list_foreach(inet_links, link_list, inet_link_t, ilink) {
 		if (ilink->svc_id == link_id) {
-			fibril_mutex_unlock(&inet_discovery_lock);
+			fibril_mutex_unlock(&inet_links_lock);
 			return ilink;
 		}
 	}
 
-	fibril_mutex_unlock(&inet_discovery_lock);
+	fibril_mutex_unlock(&inet_links_lock);
 	return NULL;
 }
@@ -499,20 +432,20 @@
 	size_t count, i;
 
-	fibril_mutex_lock(&inet_discovery_lock);
-	count = list_count(&inet_link_list);
+	fibril_mutex_lock(&inet_links_lock);
+	count = list_count(&inet_links);
 
 	id_list = calloc(count, sizeof(sysarg_t));
 	if (id_list == NULL) {
-		fibril_mutex_unlock(&inet_discovery_lock);
+		fibril_mutex_unlock(&inet_links_lock);
 		return ENOMEM;
 	}
 
 	i = 0;
-	list_foreach(inet_link_list, link_list, inet_link_t, ilink) {
+	list_foreach(inet_links, link_list, inet_link_t, ilink) {
 		id_list[i++] = ilink->svc_id;
 		log_msg(LOG_DEFAULT, LVL_NOTE, "add link to list");
 	}
 
-	fibril_mutex_unlock(&inet_discovery_lock);
+	fibril_mutex_unlock(&inet_links_lock);
 
 	log_msg(LOG_DEFAULT, LVL_NOTE, "return %zu links", count);
