diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 1e7d8e0..1eaea4e 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,3 +1,8 @@
+2004-05-01 Paul Jakma <paul@dishone.st>
+
+	* Revert the attempted clean-up of the dummy peer hack, reverts
+	  patchsets 435 (see 2004-02-17 below) and 456. 
+
 2004-04-16 rivo nurges <rix@estpak.ee>
 
 	* bgpd.h, bgp_debug.c: update cease subcodes to
diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c
index fc1324a..4778a97 100644
--- a/bgpd/bgp_advertise.c
+++ b/bgpd/bgp_advertise.c
@@ -292,7 +292,7 @@
       FIFO_ADD (&peer->sync[afi][safi]->withdraw, &adv->fifo);
 
       /* Schedule packet write. */
-      BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+      BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
     }
   else
     {
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index ac25f15..3d8e957 100644
--- a/bgpd/bgp_fsm.c
+++ b/bgpd/bgp_fsm.c
@@ -292,7 +292,7 @@
 
   peer->synctime = time (NULL);
 
-  BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
 
   BGP_TIMER_ON (peer->t_routeadv, bgp_routeadv_timer,
 		peer->v_routeadv);
@@ -307,21 +307,6 @@
   peer->uptime = time (NULL);
 }
 
-void
-bgp_connection_stop (struct peer *peer)
-{
-  if (peer->fd_local >= 0)
-    {
-      close (peer->fd_local);
-      peer->fd_local = -1;
-    }
-  if (peer->fd_accept >= 0)
-    {
-      close (peer->fd_accept);
-      peer->fd_accept = -1;
-    }
-}
-
 /* Administrative BGP peer stop event. */
 int
 bgp_stop (struct peer *peer)
@@ -382,8 +367,12 @@
     stream_reset (peer->work);
   stream_fifo_clean (peer->obuf);
 
-  /* Close of connections. */
-  bgp_connection_stop (peer);
+  /* Close of file descriptor. */
+  if (peer->fd >= 0)
+    {
+      close (peer->fd);
+      peer->fd = -1;
+    }
 
   /* Connection information. */
   if (peer->su_local)
@@ -397,7 +386,7 @@
       XFREE (MTYPE_SOCKUNION, peer->su_remote);
       peer->su_remote = NULL;
     }
-    
+
   /* Clear remote router-id. */
   peer->remote_id.s_addr = 0;
 
@@ -488,13 +477,13 @@
 int
 bgp_connect_success (struct peer *peer)
 {
-  if (peer->fd_local < 0)
+  if (peer->fd < 0)
     {
       zlog_err ("bgp_connect_success peer's fd is negative value %d",
-                peer->fd_local);
+		peer->fd);
       return -1;
     }
-  BGP_READ_ON (peer->t_read, bgp_read, peer->fd_local);
+  BGP_READ_ON (peer->t_read, bgp_read, peer->fd);
 
   /* bgp_getsockname (peer); */
 
@@ -532,29 +521,29 @@
     {
     case connect_error:
       if (BGP_DEBUG (fsm, FSM))
-        plog_info (peer->log, "%s [FSM] Connect error", peer->host);
+	plog_info (peer->log, "%s [FSM] Connect error", peer->host);
       BGP_EVENT_ADD (peer, TCP_connection_open_failed);
       break;
     case connect_success:
       if (BGP_DEBUG (fsm, FSM))
-        plog_info (peer->log, "%s [FSM] Connect immediately success",
-                   peer->host);
+	plog_info (peer->log, "%s [FSM] Connect immediately success",
+		   peer->host);
       BGP_EVENT_ADD (peer, TCP_connection_open);
       break;
     case connect_in_progress:
       /* To check nonblocking connect, we wait until socket is
          readable or writable. */
       if (BGP_DEBUG (fsm, FSM))
-        plog_info (peer->log, "%s [FSM] Non blocking connect waiting result",
-                   peer->host);
-      if (*peer->fd < 0)
+	plog_info (peer->log, "%s [FSM] Non blocking connect waiting result",
+		   peer->host);
+      if (peer->fd < 0)
 	{
 	  zlog_err ("bgp_start peer's fd is negative value %d",
-		    *peer->fd);
+		    peer->fd);
 	  return -1;
 	}
-      BGP_READ_ON (peer->t_read, bgp_read, *peer->fd);
-      BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+      BGP_READ_ON (peer->t_read, bgp_read, peer->fd);
+      BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
       break;
     }
   return 0;
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index e03831d..aa369bc 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -46,6 +46,7 @@
   int accept_sock;
   union sockunion su;
   struct peer *peer;
+  struct peer *peer1;
   struct bgp *bgp;
   char buf[SU_ADDRSTRLEN];
 
@@ -72,12 +73,12 @@
     zlog_info ("[Event] BGP connection from host %s", inet_sutop (&su, buf));
   
   /* Check remote IP address */
-  peer = peer_lookup (bgp, &su);
-  if (! peer || peer->status == Idle)
+  peer1 = peer_lookup (bgp, &su);
+  if (! peer1 || peer1->status == Idle)
     {
       if (BGP_DEBUG (events, EVENTS))
 	{
-	  if (! peer)
+	  if (! peer1)
 	    zlog_info ("[Event] BGP connection IP address %s is not configured",
 		       inet_sutop (&su, buf));
 	  else
@@ -89,13 +90,30 @@
     }
 
   /* In case of peer is EBGP, we should set TTL for this connection.  */
-  if (peer_sort (peer) == BGP_PEER_EBGP)
-    sockopt_ttl (peer->su.sa.sa_family, bgp_sock, peer->ttl);
+  if (peer_sort (peer1) == BGP_PEER_EBGP)
+    sockopt_ttl (peer1->su.sa.sa_family, bgp_sock, peer1->ttl);
 
   if (! bgp)
-    bgp = peer->bgp;
+    bgp = peer1->bgp;
 
-  peer->fd_accept = bgp_sock;
+  /* Make dummy peer until read Open packet. */
+  if (BGP_DEBUG (events, EVENTS))
+    zlog_info ("[Event] Make dummy peer structure until read Open packet");
+
+  {
+    char buf[SU_ADDRSTRLEN + 1];
+
+    peer = peer_create_accept (bgp);
+    SET_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER);
+    peer->su = su;
+    peer->fd = bgp_sock;
+    peer->status = Active;
+    peer->local_id = peer1->local_id;
+
+    /* Make peer's address string. */
+    sockunion2str (&su, buf, SU_ADDRSTRLEN);
+    peer->host = strdup (buf);
+  }
 
   BGP_EVENT_ADD (peer, TCP_connection_open);
 
@@ -115,7 +133,7 @@
 
   strncpy ((char *)&ifreq.ifr_name, peer->ifname, sizeof (ifreq.ifr_name));
 
-  ret = setsockopt (*peer->fd, SOL_SOCKET, SO_BINDTODEVICE, 
+  ret = setsockopt (peer->fd, SOL_SOCKET, SO_BINDTODEVICE, 
 		    &ifreq, sizeof (ifreq));
   if (ret < 0)
     {
@@ -189,12 +207,12 @@
       if (! addr)
 	return;
 
-      bgp_bind_address (*peer->fd, addr);
+      bgp_bind_address (peer->fd, addr);
     }
 
   /* Source is specified with IP address.  */
   if (peer->update_source)
-    sockunion_bind (*peer->fd, peer->update_source, 0, peer->update_source);
+    sockunion_bind (peer->fd, peer->update_source, 0, peer->update_source);
 }
 
 /* BGP try to connect to the peer.  */
@@ -204,16 +222,16 @@
   unsigned int ifindex = 0;
 
   /* Make socket for the peer. */
-  *peer->fd = sockunion_socket (&peer->su);
-  if (*peer->fd < 0)
+  peer->fd = sockunion_socket (&peer->su);
+  if (peer->fd < 0)
     return -1;
 
   /* If we can get socket for the peer, adjest TTL and make connection. */
   if (peer_sort (peer) == BGP_PEER_EBGP)
-    sockopt_ttl (peer->su.sa.sa_family, *peer->fd, peer->ttl);
+    sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
 
-  sockopt_reuseaddr (*peer->fd);
-  sockopt_reuseport (*peer->fd);
+  sockopt_reuseaddr (peer->fd);
+  sockopt_reuseport (peer->fd);
 
   /* Bind socket. */
   bgp_bind (peer);
@@ -228,10 +246,10 @@
 
   if (BGP_DEBUG (events, EVENTS))
     plog_info (peer->log, "%s [Event] Connect start to %s fd %d",
-	       peer->host, peer->host, *peer->fd);
+	       peer->host, peer->host, peer->fd);
 
   /* Connect to the remote peer. */
-  return sockunion_connect (*peer->fd, &peer->su, htons (peer->port), ifindex);
+  return sockunion_connect (peer->fd, &peer->su, htons (peer->port), ifindex);
 }
 
 /* After TCP connection is established.  Get local address and port. */
@@ -250,8 +268,8 @@
       peer->su_remote = NULL;
     }
 
-  peer->su_local = sockunion_getsockname (*peer->fd);
-  peer->su_remote = sockunion_getpeername (*peer->fd);
+  peer->su_local = sockunion_getsockname (peer->fd);
+  peer->su_remote = sockunion_getpeername (peer->fd);
 
   bgp_nexthop_set (peer->su_local, peer->su_remote, &peer->nexthop, peer);
 }
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index 7d921be..48879f3 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -133,7 +133,7 @@
 
   /* Check file descriptor. */
   slen = sizeof (status);
-  ret = getsockopt(*peer->fd, SOL_SOCKET, SO_ERROR, (void *) &status, &slen);
+  ret = getsockopt(peer->fd, SOL_SOCKET, SO_ERROR, (void *) &status, &slen);
 
   /* If getsockopt is fail, this is fatal error. */
   if (ret < 0)
@@ -238,6 +238,7 @@
       bgp_packet_set_size (s);
       packet = bgp_packet_dup (s);
       bgp_packet_add (peer, packet);
+      BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
       stream_reset (s);
       return packet;
     }
@@ -394,7 +395,7 @@
   /* Add packet to the peer. */
   bgp_packet_add (peer, packet);
 
-  BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
 }
 
 void
@@ -468,7 +469,7 @@
   /* Add packet to the peer. */
   bgp_packet_add (peer, packet);
 
-  BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
 }
 
 /* Get next packet to be written.  */
@@ -574,7 +575,7 @@
       writenum = stream_get_endp (s) - stream_get_getp (s);
 
       /* Call write() system call.  */
-      num = write (*peer->fd, STREAM_PNT (s), writenum);
+      num = write (peer->fd, STREAM_PNT (s), writenum);
       write_errno = errno;
       if (num <= 0)
 	{
@@ -644,7 +645,7 @@
     }
   
   if (bgp_write_proceed (peer))
-    BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+    BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
   
   return 0;
 }
@@ -664,7 +665,7 @@
   assert (stream_get_endp (s) >= BGP_HEADER_SIZE);
 
   /* I'm not sure fd is writable. */
-  ret = writen (*peer->fd, STREAM_DATA (s), stream_get_endp (s));
+  ret = writen (peer->fd, STREAM_DATA (s), stream_get_endp (s));
   if (ret <= 0)
     {
       bgp_stop (peer);
@@ -724,7 +725,7 @@
   /* Add packet to the peer. */
   bgp_packet_add (peer, s);
 
-  BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
 }
 
 /* Make open packet and send it to the peer. */
@@ -779,7 +780,7 @@
   /* Add packet to the peer. */
   bgp_packet_add (peer, s);
 
-  BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
 }
 
 /* Send BGP notify packet with data potion. */
@@ -980,7 +981,7 @@
   /* Add packet to the peer. */
   bgp_packet_add (peer, packet);
 
-  BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
 }
 
 /* Send capability message to the peer. */
@@ -1047,13 +1048,14 @@
     zlog_info ("%s send message type %d, length (incl. header) %d",
 	       peer->host, BGP_MSG_CAPABILITY, length);
 
-  BGP_WRITE_ON (peer->t_write, bgp_write, *peer->fd);
+  BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
 }
 
 /* RFC1771 6.8 Connection collision detection. */
 int
-bgp_collision_detect (struct peer *peer, struct in_addr remote_id)
+bgp_collision_detect (struct peer *new, struct in_addr remote_id)
 {
+  struct peer *peer;
   struct listnode *nn;
   struct bgp *bgp;
 
@@ -1074,10 +1076,11 @@
     {
       /* Under OpenConfirm status, local peer structure already hold
          remote router ID. */
-      if ((peer->status == OpenConfirm)
-          && ( ntohl(peer->remote_id.s_addr) == ntohl(remote_id.s_addr) )
-         )
-        {
+
+      if (peer != new
+	  && (peer->status == OpenConfirm || peer->status == OpenSent)
+	  && sockunion_same (&peer->su, &new->su))
+	{
 	  /* 1. The BGP Identifier of the local system is compared to
 	     the BGP Identifier of the remote system (as specified in
 	     the OPEN message). */
@@ -1090,16 +1093,8 @@
 		 already in the OpenConfirm state), and accepts BGP
 		 connection initiated by the remote system. */
 
-	      if (peer->fd_local >= 0)
-	        {
-	          BGP_WRITE_OFF (peer->t_write);
-	          BGP_READ_OFF (peer->t_read);
-	          close (peer->fd_local);
-	        }
-	      peer->fd_local = -1;
-	      peer->fd = &peer->fd_accept;
-
-	      BGP_READ_ON (peer->t_read, bgp_read, *peer->fd);
+	      if (peer->fd >= 0)
+		bgp_notify_send (peer, BGP_NOTIFY_CEASE, 0);
 	      return 1;
 	    }
 	  else
@@ -1110,15 +1105,12 @@
 		 existing one (the one that is already in the
 		 OpenConfirm state). */
 
-	      if (peer->fd_accept >= 0)
-	        {
-	          close (peer->fd_accept);
-	          peer->fd_accept = -1;
-	        }    
+	      if (new->fd >= 0)
+		bgp_notify_send (new, BGP_NOTIFY_CEASE, 0);
 	      return -1;
 	    }
-	  }
-    }    
+	}
+    }
   return 0;
 }
 
@@ -1195,6 +1187,51 @@
   if (ret < 0)
     return ret;
 
+  /* Hack part. */
+  if (CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+    {
+      if (ret == 0 && realpeer->status != Active
+	  && realpeer->status != OpenSent
+	  && realpeer->status != OpenConfirm)
+ 	{
+ 	  if (BGP_DEBUG (events, EVENTS))
+ 	    zlog_info ("%s [Event] peer's status is %s close connection",
+		       realpeer->host, LOOKUP (bgp_status_msg, peer->status));
+ 	  return -1;
+ 	}
+
+      if (BGP_DEBUG (events, EVENTS))
+	zlog_info ("%s [Event] Transfer temporary BGP peer to existing one",
+		   peer->host);
+
+      bgp_stop (realpeer);
+      
+      /* Transfer file descriptor. */
+      realpeer->fd = peer->fd;
+      peer->fd = -1;
+
+      /* Transfer input buffer. */
+      stream_free (realpeer->ibuf);
+      realpeer->ibuf = peer->ibuf;
+      realpeer->packet_size = peer->packet_size;
+      peer->ibuf = NULL;
+
+      /* Transfer status. */
+      realpeer->status = peer->status;
+      bgp_stop (peer);
+
+      /* peer pointer change. Open packet send to neighbor. */
+      peer = realpeer;
+      bgp_open_send (peer);
+      if (peer->fd < 0)
+	{
+	  zlog_err ("bgp_open_receive peer's fd is negative value %d",
+		    peer->fd);
+	  return -1;
+	}
+      BGP_READ_ON (peer->t_read, bgp_read, peer->fd);
+    }
+
   /* remote router-id check. */
   if (remote_id.s_addr == 0
       || ntohl (remote_id.s_addr) >= 0xe0000000
@@ -1994,7 +2031,7 @@
     return 0;
 
   /* Read packet from fd. */
-  nbytes = stream_read_unblock (peer->ibuf, *peer->fd, readsize);
+  nbytes = stream_read_unblock (peer->ibuf, peer->fd, readsize);
 
   /* If read byte is smaller than zero then error occured. */
   if (nbytes < 0) 
@@ -2013,7 +2050,7 @@
     {
       if (BGP_DEBUG (events, EVENTS))
 	plog_info (peer->log, "%s [Event] BGP connection closed fd %d",
-		   peer->host, *peer->fd);
+		   peer->host, peer->fd);
       BGP_EVENT_ADD (peer, TCP_connection_closed);
       return -1;
     }
@@ -2060,12 +2097,12 @@
     }
   else
     {
-      if (*peer->fd < 0)
+      if (peer->fd < 0)
 	{
-	  zlog_err ("bgp_read peer's fd is negative value %d", *peer->fd);
+	  zlog_err ("bgp_read peer's fd is negative value %d", peer->fd);
 	  return -1;
 	}
-      BGP_READ_ON (peer->t_read, bgp_read, *peer->fd);
+      BGP_READ_ON (peer->t_read, bgp_read, peer->fd);
     }
 
   /* Read packet header to determine type of the packet */
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 7025a8f..32227cb 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4202,8 +4202,7 @@
 	    vty_out (vty, " (inaccessible)"); 
 	  else if (binfo->igpmetric)
 	    vty_out (vty, " (metric %d)", binfo->igpmetric);
-	  vty_out (vty, " from %s", 
-	           sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN));
+	  vty_out (vty, " from %s", sockunion2str (&binfo->peer->su, buf, SU_ADDRSTRLEN));
 	  if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_ORIGINATOR_ID))
 	    vty_out (vty, " (%s)", inet_ntoa (attr->originator_id));
 	  else
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index ae8af9f..e9d81de 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -504,10 +504,11 @@
   return 0;
 }
 
+/* Peer comparison function for sorting.  */
 static int
 peer_cmp (struct peer *p1, struct peer *p2)
 {
-  return sockunion_cmp (&p1->su, &p2->su);  
+  return sockunion_cmp (&p1->su, &p2->su);
 }
 
 int
@@ -683,11 +684,8 @@
   peer = XMALLOC (MTYPE_BGP_PEER, sizeof (struct peer));
   memset (peer, 0, sizeof (struct peer));
 
-  peer->fd = &peer->fd_local;
-
   /* Set default value. */
-  peer->fd_local = -1;
-  peer->fd_accept = -1;
+  peer->fd = -1;
   peer->v_start = BGP_INIT_START_TIMER;
   peer->v_connect = BGP_DEFAULT_CONNECT_RETRY;
   peer->v_asorig = BGP_DEFAULT_ASORIGINATE;
@@ -771,6 +769,19 @@
   return peer;
 }
 
+/* Make accept BGP peer.  Called from bgp_accept (). */
+struct peer *
+peer_create_accept (struct bgp *bgp)
+{
+  struct peer *peer;
+
+  peer = peer_new ();
+  peer->bgp = bgp;
+  listnode_add_sort (bgp->peer, peer);
+
+  return peer;
+}
+
 /* Change peer's AS number.  */
 void
 peer_as_change (struct peer *peer, as_t as)
@@ -1799,8 +1810,9 @@
   
   LIST_LOOP (bgp->peer, peer, nn)
     {
-      if (sockunion_same (&peer->su, su))
-        return peer;
+      if (sockunion_same (&peer->su, su)
+	  && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+	return peer;
     }
   return NULL;
 }
@@ -1819,25 +1831,27 @@
 
   LIST_LOOP (bgp->peer, peer, nn)
     {
-      if (sockunion_same (&peer->su, su))
-        {
-          if (peer->as == remote_as
-              && peer->remote_id.s_addr == remote_id->s_addr)
-            return peer;
-          if (peer->as == remote_as)
-            *as = 1;
-        }
+      if (sockunion_same (&peer->su, su)
+	  && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+	{
+	  if (peer->as == remote_as
+	      && peer->remote_id.s_addr == remote_id->s_addr)
+	    return peer;
+	  if (peer->as == remote_as)
+	    *as = 1;
+	}
     }
   LIST_LOOP (bgp->peer, peer, nn)
     {
-      if (sockunion_same (&peer->su, su))
-        {
-          if (peer->as == remote_as
-              && peer->remote_id.s_addr == 0)
-            return peer;
-          if (peer->as == remote_as)
-            *as = 1;
-        }
+      if (sockunion_same (&peer->su, su)
+	  &&  ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
+	{
+	  if (peer->as == remote_as
+	      && peer->remote_id.s_addr == 0)
+	    return peer;
+	  if (peer->as == remote_as)
+	    *as = 1;
+	}
     }
   return NULL;
 }
@@ -2264,24 +2278,22 @@
 
   if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
     {
-      if (*peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
-        sockopt_ttl (peer->su.sa.sa_family, *peer->fd, 
-                     peer->ttl);
+      if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
+	sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
     }
   else
     {
       group = peer->group;
       LIST_LOOP (group->peer, peer, nn)
-        {
-          if (peer_sort (peer) == BGP_PEER_IBGP)
-            continue;
+	{
+	  if (peer_sort (peer) == BGP_PEER_IBGP)
+	    continue;
 
-          peer->ttl = group->conf->ttl;
+	  peer->ttl = group->conf->ttl;
 
-          if (*peer->fd >= 0)
-            sockopt_ttl (peer->su.sa.sa_family,
-                         *peer->fd, peer->ttl);
-        }
+	  if (peer->fd >= 0)
+	    sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
+	}
     }
   return 0;
 }
@@ -2302,24 +2314,22 @@
 
   if (! CHECK_FLAG (peer->sflags, PEER_STATUS_GROUP))
     {
-      if (*peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
-        sockopt_ttl (peer->su.sa.sa_family, 
-                     *peer->fd, peer->ttl);
+      if (peer->fd >= 0 && peer_sort (peer) != BGP_PEER_IBGP)
+	sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
     }
   else
     {
       group = peer->group;
       LIST_LOOP (group->peer, peer, nn)
-        {
-          if (peer_sort (peer) == BGP_PEER_IBGP)
-            continue;
+	{
+	  if (peer_sort (peer) == BGP_PEER_IBGP)
+	    continue;
 
-          peer->ttl = 1;
-          
-          if (*peer->fd >= 0)
-            sockopt_ttl (peer->su.sa.sa_family,
-                         *peer->fd, peer->ttl);
-        }
+	  peer->ttl = 1;
+	  
+	  if (peer->fd >= 0)
+	    sockopt_ttl (peer->su.sa.sa_family, peer->fd, peer->ttl);
+	}
     }
   return 0;
 }
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h
index 6f22e53..b10e6b6 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -256,29 +256,27 @@
   int ostatus;
 
   /* Peer information */
-  int *fd;                        /* connection in use: -> local||accept */
-  int ttl;                        /* TTL of TCP connection to the peer. */
-  int fd_local;                   /* locally initiated connection */
-  int fd_accept;                  /* remote initiated/accepted connection */
-  char *desc;                     /* Description of the peer. */
-  unsigned short port;            /* Destination port for peer */
-  char *host;                     /* Printable address of the peer. */
-  union sockunion su;             /* Sockunion address of the peer. */
-  time_t uptime;                  /* Last Up/Down time */
-  time_t readtime;                /* Last read time */
-  time_t resettime;               /* Last reset time */
+  int fd;			/* File descriptor */
+  int ttl;			/* TTL of TCP connection to the peer. */
+  char *desc;			/* Description of the peer. */
+  unsigned short port;          /* Destination port for peer */
+  char *host;			/* Printable address of the peer. */
+  union sockunion su;		/* Sockunion address of the peer. */
+  time_t uptime;		/* Last Up/Down time */
+  time_t readtime;		/* Last read time */
+  time_t resettime;		/* Last reset time */
   
-  unsigned int ifindex;           /* ifindex of the BGP connection. */
-  char *ifname;                   /* bind interface name. */
-  char *update_if;                /* interface to send from */
-  union sockunion *update_source; /* sockunion to send from */
-  struct zlog *log;               /* log socket */
-  u_char version;                 /* Peer BGP version. */
+  unsigned int ifindex;		/* ifindex of the BGP connection. */
+  char *ifname;			/* bind interface name. */
+  char *update_if;
+  union sockunion *update_source;
+  struct zlog *log;
+  u_char version;		/* Peer BGP version. */
 
-  union sockunion *su_local;      /* Sockunion of local address.  */
-  union sockunion *su_remote;     /* Sockunion of remote address.  */
-  int shared_network;             /* Is this peer shared same network. */
-  struct bgp_nexthop nexthop;     /* Nexthop */
+  union sockunion *su_local;	/* Sockunion of local address.  */
+  union sockunion *su_remote;	/* Sockunion of remote address.  */
+  int shared_network;		/* Is this peer shared same network. */
+  struct bgp_nexthop nexthop;	/* Nexthop */
 
   /* Peer address family configuration. */
   u_char afc[AFI_MAX][SAFI_MAX];
