diff --git a/isisd/ChangeLog b/isisd/ChangeLog
index 3735b4f..36098d1 100644
--- a/isisd/ChangeLog
+++ b/isisd/ChangeLog
@@ -1,5 +1,9 @@
 2005-09-19 Hasso Tepper <hasso at quagga.net>
 
+	* isis_lsp.c, isis_pdu.c, isis_spf.c: Remove some old unused code.
+
+2005-09-19 Hasso Tepper <hasso at quagga.net>
+
 	* isis_lsp.c: Better output of detailed LSP printout and fixed TE IPv4
 	  reachibility metric display.
 
diff --git a/isisd/isis_lsp.c b/isisd/isis_lsp.c
index d02f383..b7ddfd9 100644
--- a/isisd/isis_lsp.c
+++ b/isisd/isis_lsp.c
@@ -915,246 +915,6 @@
   return lsp_count;
 }
 
-#if 0
-/* this function reallocate memory to an lsp pdu, with an additional
- * size of memory, it scans the lsp and moves all pointers the
- * way they should */
-static u_char *
-lsppdu_realloc (struct isis_lsp * lsp, int memorytype, int size)
-{
-  u_char *retval;
-
-  retval = STREAM_DATA (lsp->pdu) + ntohs (lsp->lsp_header->pdu_len);
-#ifdef   LSP_MEMORY_PREASSIGN
-  lsp->lsp_header->pdu_len = htons (ntohs (lsp->lsp_header->pdu_len) + size);
-  return retval;
-#else /* otherwise we have to move all pointers */
-  u_char *newpdu;
-  newpdu = stream_new (ntohs (lsp->lsp_header->pdu_len) + size);
-  stream_put (newpdu, STREAM_DATA(lsp->pdu), ntohs (lsp->lsp_header->pdu_len));
-  XFREE (memorytype, lsp->pdu);
-  lsp->pdu = newpdu;
-  lsp->isis_header = (struct isis_fixed_hdr *) STREAM_DATA (lsp->pdu);
-  lsp->lsp_header = (struct isis_link_state_hdr *)
-    (STREAM_DATA (lsp->pdu) + ISIS_FIXED_HDR_LEN);
-  htons (ntohs (lsp->lsp_header->pdu_len) += size);
-  return STREAM_DATA (lsp->pdu) + (lsp->lsp_header->pdu_len - size);
-#endif /* LSP_MEMORY_PREASSIGN */
-}
-#endif
-
-#if 0				/* Saving the old one just in case :) */
-/*
- * Builds the lsp->tlv_data
- * and writes the tlvs into lsp->pdu 
- */
-void
-lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
-{
-  struct is_neigh *is_neigh;
-  struct listnode *node, *nnode, *ipnode, *ipnnode;
-  int level = lsp->level;
-  struct isis_circuit *circuit;
-  struct prefix_ipv4 *ipv4;
-  struct ipv4_reachability *ipreach;
-  struct isis_adjacency *nei;
-#ifdef HAVE_IPV6
-  struct prefix_ipv6 *ipv6;
-  struct ipv6_reachability *ip6reach;
-#endif /* HAVE_IPV6 */
-
-  /*
-   * First add the tlvs related to area
-   */
-
-  /* Area addresses */
-  if (lsp->tlv_data.area_addrs == NULL)
-    lsp->tlv_data.area_addrs = list_new ();
-  list_add_list (lsp->tlv_data.area_addrs, area->area_addrs);
-  /* Protocols Supported */
-  if (area->ip_circuits > 0
-#ifdef HAVE_IPV6
-      || area->ipv6_circuits > 0
-#endif /* HAVE_IPV6 */
-    )
-    {
-      lsp->tlv_data.nlpids = XMALLOC (MTYPE_ISIS_TLV, sizeof (struct nlpids));
-      lsp->tlv_data.nlpids->count = 0;
-      if (area->ip_circuits > 0)
-	{
-	  lsp->tlv_data.nlpids->count++;
-	  lsp->tlv_data.nlpids->nlpids[0] = NLPID_IP;
-	}
-#ifdef HAVE_IPV6
-      if (area->ipv6_circuits > 0)
-	{
-	  lsp->tlv_data.nlpids->count++;
-	  lsp->tlv_data.nlpids->nlpids[lsp->tlv_data.nlpids->count - 1] =
-	    NLPID_IPV6;
-	}
-#endif /* HAVE_IPV6 */
-    }
-  /* Dynamic Hostname */
-  if (area->dynhostname)
-    {
-      lsp->tlv_data.hostname = XMALLOC (MTYPE_ISIS_TLV,
-					sizeof (struct hostname));
-      memcpy (&lsp->tlv_data.hostname->name, unix_hostname (),
-	      strlen (unix_hostname ()));
-      lsp->tlv_data.hostname->namelen = strlen (unix_hostname ());
-    }
-#ifdef TOPOLOGY_GENERATE
-  /*
-   * If we have a topology in this area, we need to connect this lsp to
-   * the first topology lsp
-   */
-  if ((area->topology) && (level == 1))
-    {
-      if (lsp->tlv_data.is_neighs == NULL)
-	lsp->tlv_data.is_neighs = list_new ();
-      is_neigh = XCALLOC (MTYPE_ISIS_TLV, sizeof (struct is_neigh));
-      memcpy (&is_neigh->neigh_id, area->topology_baseis, ISIS_SYS_ID_LEN);
-      /* connected to the first */
-      is_neigh->neigh_id[ISIS_SYS_ID_LEN - 1] = (0x01);
-      /* this is actually the same system, why mess the SPT */
-      is_neigh->metrics.metric_default = 0;
-      is_neigh->metrics.metric_delay = METRICS_UNSUPPORTED;
-      is_neigh->metrics.metric_expense = METRICS_UNSUPPORTED;
-      is_neigh->metrics.metric_error = METRICS_UNSUPPORTED;
-      listnode_add (lsp->tlv_data.is_neighs, is_neigh);
-
-    }
-#endif
-
-  /*
-   * Then add tlvs related to circuits
-   */
-  for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
-    {
-      if (circuit->state != C_STATE_UP)
-	continue;
-
-      /*
-       * Add IPv4 internal reachability of this circuit
-       */
-      if (circuit->ip_router && circuit->ip_addrs &&
-	  circuit->ip_addrs->count > 0)
-	{
-	  if (lsp->tlv_data.ipv4_int_reachs == NULL)
-	    {
-	      lsp->tlv_data.ipv4_int_reachs = list_new ();
-	      lsp->tlv_data.ipv4_int_reachs->del = free_tlv;
-	    }
-          for (ALL_LIST_ELEMENTS (circuit->ip_addrs, ipnode, ipnnode, ipv4))
-	    {
-	      ipreach =
-		XCALLOC (MTYPE_ISIS_TLV, sizeof (struct ipv4_reachability));
-	      ipreach->metrics = circuit->metrics[level - 1];
-	      ipreach->prefix = ipv4->prefix;
-	      masklen2ip (ipv4->prefixlen, &ipreach->mask);
-	      listnode_add (lsp->tlv_data.ipv4_int_reachs, ipreach);
-	    }
-	}
-#ifdef HAVE_IPV6
-      /*
-       * Add IPv6 reachability of this circuit
-       */
-      if (circuit->ipv6_router && circuit->ipv6_non_link &&
-	  circuit->ipv6_non_link->count > 0)
-	{
-	  if (lsp->tlv_data.ipv6_reachs == NULL)
-	    {
-	      lsp->tlv_data.ipv6_reachs = list_new ();
-	      lsp->tlv_data.ipv6_reachs->del = free_tlv;
-	    }
-          for (ALL_LIST_ELEMENTS (circuit->ipv6_non_link, ipnode, 
-                                  ipnnode, ipv6))
-	    {
-	      ip6reach =
-		XCALLOC (MTYPE_ISIS_TLV, sizeof (struct ipv6_reachability));
-	      ip6reach->metric =
-		htonl (circuit->metrics[level - 1].metric_default);
-	      ip6reach->control_info = 0;
-	      ip6reach->prefix_len = ipv6->prefixlen;
-	      memcpy (&ip6reach->prefix, ipv6->prefix.s6_addr,
-		      (ipv6->prefixlen + 7) / 8);
-	      listnode_add (lsp->tlv_data.ipv6_reachs, ip6reach);
-	    }
-	}
-#endif /* HAVE_IPV6 */
-
-      switch (circuit->circ_type)
-	{
-	case CIRCUIT_T_BROADCAST:
-	  if (level & circuit->circuit_is_type)
-	    {
-	      if (lsp->tlv_data.is_neighs == NULL)
-		{
-		  lsp->tlv_data.is_neighs = list_new ();
-		  lsp->tlv_data.is_neighs->del = free_tlv;
-		}
-	      is_neigh = XCALLOC (MTYPE_ISIS_TLV, sizeof (struct is_neigh));
-	      if (level == 1)
-		memcpy (&is_neigh->neigh_id,
-			circuit->u.bc.l1_desig_is, ISIS_SYS_ID_LEN + 1);
-	      else
-		memcpy (&is_neigh->neigh_id,
-			circuit->u.bc.l2_desig_is, ISIS_SYS_ID_LEN + 1);
-	      is_neigh->metrics = circuit->metrics[level - 1];
-	      listnode_add (lsp->tlv_data.is_neighs, is_neigh);
-	    }
-	  break;
-	case CIRCUIT_T_P2P:
-	  nei = circuit->u.p2p.neighbor;
-	  if (nei && (level & nei->circuit_t))
-	    {
-	      if (lsp->tlv_data.is_neighs == NULL)
-		{
-		  lsp->tlv_data.is_neighs = list_new ();
-		  lsp->tlv_data.is_neighs->del = free_tlv;
-		}
-	      is_neigh = XCALLOC (MTYPE_ISIS_TLV, sizeof (struct is_neigh));
-	      memcpy (&is_neigh->neigh_id, nei->sysid, ISIS_SYS_ID_LEN);
-	      is_neigh->metrics = circuit->metrics[level - 1];
-	      listnode_add (lsp->tlv_data.is_neighs, is_neigh);
-	    }
-	  break;
-	case CIRCUIT_T_STATIC_IN:
-	  zlog_warn ("lsp_area_create: unsupported circuit type");
-	  break;
-	case CIRCUIT_T_STATIC_OUT:
-	  zlog_warn ("lsp_area_create: unsupported circuit type");
-	  break;
-	case CIRCUIT_T_DA:
-	  zlog_warn ("lsp_area_create: unsupported circuit type");
-	  break;
-	default:
-	  zlog_warn ("lsp_area_create: unknown circuit type");
-	}
-    }
-
-  if (lsp->tlv_data.nlpids)
-    tlv_add_nlpid (lsp->tlv_data.nlpids, lsp->pdu);
-  if (lsp->tlv_data.hostname)
-    tlv_add_dynamic_hostname (lsp->tlv_data.hostname, lsp->pdu);
-  if (lsp->tlv_data.area_addrs && listcount (lsp->tlv_data.area_addrs) > 0)
-    tlv_add_area_addrs (lsp->tlv_data.area_addrs, lsp->pdu);
-  if (lsp->tlv_data.is_neighs && listcount (lsp->tlv_data.is_neighs) > 0)
-    tlv_add_is_neighs (lsp->tlv_data.is_neighs, lsp->pdu);
-  if (lsp->tlv_data.ipv4_int_reachs &&
-      listcount (lsp->tlv_data.ipv4_int_reachs) > 0)
-    tlv_add_ipv4_reachs (lsp->tlv_data.ipv4_int_reachs, lsp->pdu);
-#ifdef  HAVE_IPV6
-  if (lsp->tlv_data.ipv6_reachs && listcount (lsp->tlv_data.ipv6_reachs) > 0)
-    tlv_add_ipv6_reachs (lsp->tlv_data.ipv6_reachs, lsp->pdu);
-#endif /* HAVE_IPV6 */
-
-  lsp->lsp_header->pdu_len = htons (stream_get_endp (lsp->pdu));
-
-  return;
-}
-#endif
-
 #define FRAG_THOLD(S,T) \
 ((STREAM_SIZE(S)*T)/100)
 
@@ -1244,7 +1004,6 @@
  * Builds the LSP data part. This func creates a new frag whenever 
  * area->lsp_frag_threshold is exceeded.
  */
-#if 1
 static void
 lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
 {
@@ -1536,72 +1295,6 @@
 
   return;
 }
-#endif
-
-#if 0 /* Old code? */
-static void
-build_lsp_data (struct isis_lsp *lsp, struct isis_area *area)
-{
-  struct list *circuit_list = area->circuit_list;
-  struct isis_circuit *circuit;
-  u_char *tlv_ptr;
-  struct is_neigh *is_neigh;
-
-
-  /* add our nlpids */
-  /* the 2 is for the TL plus 1 for the nlpid */
-  tlv_ptr = lsppdu_realloc (lsp, MTYPE_ISIS_TLV, 3);
-  *tlv_ptr = PROTOCOLS_SUPPORTED;	/* Type */
-  *(tlv_ptr + 1) = 1;		/* one protocol */
-#ifdef HAVE_IPV6		/*dunno if its right */
-  *(tlv_ptr + 2) = NLPID_IPV6;
-#else
-  *(tlv_ptr + 2) = NLPID_IP;
-#endif /* HAVE_IPV6 */
-
-  /* we should add our areas here
-   * FIXME: we need to figure out which should be added? Adj? All? First? */
-
-  /* first, lets add ourselves to the IS neighbours info */
-  /* the 2 is for the TL plus 1 for the virtual field */
-  tlv_ptr = lsppdu_realloc (lsp, MTYPE_ISIS_TLV, 3);
-  *tlv_ptr = IS_NEIGHBOURS;	/* Type */
-  *(tlv_ptr + 2) = 0;		/* virtual is zero */
-  lsp->tlv_data.is_neighs = list_new ();	/* new list of is_neighbours */
-  /* assign space for the is_neigh at the pdu end */
-  is_neigh = (struct is_neigh *) lsppdu_realloc (lsp, MTYPE_ISIS_TLV,
-						 sizeof (struct is_neigh));
-  /* add this node to our list */
-  listnode_add (lsp->tlv_data.is_neighs, is_neigh);
-  /* FIXME: Do we need our designated address here? */
-  memcpy (&is_neigh->neigh_id, isis->sysid, ISIS_SYS_ID_LEN + 1);
-  /* FIXME: Where should we really get our own LSPs metrics from? */
-  circuit = (struct isis_circuit *) listhead (circuit_list);
-  /* is_neigh->metrics = circuit->metrics[lsp->level -1]; */
-  /* Length */
-  *(tlv_ptr + 1) =
-    (lsp->tlv_data.is_neighs->count * sizeof (struct is_neigh) + 1);
-
-  /* FIXME: scan for adjencecies and add them */
-
-  /* FIXME: add reachability info */
-
-  /* adding dynamic hostname if needed */
-  if (area->dynhostname)
-    {
-      tlv_ptr = lsppdu_realloc (lsp, MTYPE_ISIS_TLV, 2);	/* the 2 is for the TL */
-      *tlv_ptr = DYNAMIC_HOSTNAME;	/* Type */
-      *(tlv_ptr + 1) = strlen (unix_hostname ());	/* Length */
-      lsp->tlv_data.hostname = (struct hostname *)
-	(lsppdu_realloc (lsp, MTYPE_ISIS_TLV,
-			 /* the -1 is to fit the length in the struct */
-			 strlen (unix_hostname ())) - 1);
-      memcpy (lsp->tlv_data.hostname->name, unix_hostname (),
-	      strlen (unix_hostname ()));
-    }
-
-}
-#endif /* 0 */
 
 /*
  * 7.3.7 Generation on non-pseudonode LSPs
diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c
index 87f3790..591b491 100644
--- a/isisd/isis_pdu.c
+++ b/isisd/isis_pdu.c
@@ -2452,19 +2452,6 @@
   return retval;
 }
 
-/* FIXME: Not used any more? */
-/* static void
-build_link_state (struct isis_lsp *lsp, struct isis_circuit *circuit,
-		  struct stream *stream)
-{
-  unsigned long length;
-
-  stream_put (stream, lsp->pdu, ntohs (lsp->lsp_header->pdu_len));
-  length = stream_get_endp (stream);
-
-  return;
-} */
-
 /*
  * ISO 10589 - 7.3.14.3
  */
@@ -2606,91 +2593,3 @@
   return retval;
 }
 
-#if 0
-/*
- * ISH PDU Processing 
- */
-
-  /*
-   * Let's first check if the local and remote system have any common area
-   * addresses 
-   */
-if (area_match (tlvs.area_addrs, isis->man_area_addrs) == 0)
-  {
-    if (circuit->circuit_t == IS_LEVEL_2)
-      {
-	/* do as in table 8 (p. 40) */
-	switch (circuit_type)
-	  {
-	  case IS_LEVEL_1:
-	    if (adj->adj_state != ISIS_ADJ_UP)
-	      {
-		/* Reject */
-		zlog_warn ("areaMismatch");
-		retval = ISIS_WARNING;
-	      }
-	    else if (adj->adj_usage == ISIS_ADJ_LEVEL1)
-	      {
-		isis_adj_state_change (adj, ISIS_ADJ_DOWN, "Area Mismatch",
-				       circuit->adjdb);
-	      }
-	    else if (adj->adj_usage == ISIS_ADJ_LEVEL1AND2 ||
-		     adj->adj_usage == ISIS_ADJ_LEVEL2)
-	      {
-		isis_adj_state_change (adj, ISIS_ADJ_DOWN, "Wrong System",
-				       circuit->adjdb);
-	      }
-	    break;
-	  case IS_LEVEL_2:
-	    if (adj->adj_state != ISIS_ADJ_UP)
-	      {
-		isis_adj_state_change (adj, ISIS_ADJ_UP, NULL,
-				       circuit->adjdb);
-		adj->adj_usage = ISIS_ADJ_LEVEL2;
-	      }
-	    else if (adj->adj_usage == ISIS_ADJ_LEVEL1 ||
-		     adj->adj_usage == ISIS_ADJ_LEVEL1AND2)
-	      {
-		isis_adj_state_change (adj, ISIS_ADJ_DOWN, "Wrong System",
-				       circuit->adjdb);
-	      }
-	    else if (adj->adj_usage == ISIS_ADJ_LEVEL2)
-	      {
-		;		/* Accept */
-	      }
-	    break;
-	  case IS_LEVEL_1_AND_2:
-	    if (adj->adj_state != ISIS_ADJ_UP)
-	      {
-		isis_adj_state_change (adj, ISIS_ADJ_UP, NULL,
-				       circuit->adjdb);
-		adj->adj_usage = ISIS_ADJ_LEVEL2;
-	      }
-	    else if (adj->adj_usage == ISIS_ADJ_LEVEL1)
-	      {
-		isis_adj_state_change (adj, ISIS_ADJ_DOWN, "Wrong System",
-				       circuit->adjdb);
-	      }
-	    else if (adj->adj_usage == ISIS_ADJ_LEVEL1AND2)
-	      {
-		isis_adj_state_change (adj, ISIS_ADJ_DOWN, "Area Mismatch",
-				       circuit->adjdb);
-	      }
-	    else if (adj->adj_usage == ISIS_ADJ_LEVEL2)
-	      {
-		;		/* Accept */
-	      }
-	    break;
-	  }
-	goto mismatch;
-      }
-    else
-      {
-	isis_delete_adj (adj, circuit->adjdb);
-	zlog_warn ("areaMismatch");
-	return ISIS_WARNING;
-      }
-  }
-
-mismatch:
-#endif
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c
index ba7acbf..1a5a2db 100644
--- a/isisd/isis_spf.c
+++ b/isisd/isis_spf.c
@@ -58,28 +58,6 @@
 int isis_run_spf_l1 (struct thread *thread);
 int isis_run_spf_l2 (struct thread *thread);
 
-#if 0
-/* performace issue ???? HT: Old or new code? */
-static void
-union_adjlist (struct list *target, struct list *source)
-{
-  struct isis_adjacency *adj, *adj2;
-  struct listnode *node, *node2;
-
-  zlog_debug ("Union adjlist!");
-  for (ALL_LIST_ELEMENTS_RO (source, node, adj))
-    {
-      /* lookup adjacency in the source list */
-      for (ALL_LIST_ELEMENTS_RO (target, node2, adj2))
-        if (adj == adj2)
-	    break;
-      
-      if (!node2)
-	listnode_add (target, adj);
-    }
-}
-#endif
-
 /* 7.2.7 */
 static void
 remove_excess_adjs (struct list *adjs)
