diff --git a/bgpd/ChangeLog b/bgpd/ChangeLog
index 428c2b9..f28e6a0 100644
--- a/bgpd/ChangeLog
+++ b/bgpd/ChangeLog
@@ -1,8 +1,25 @@
+2004-02-17 Paul Jakma <paul@dishone.st>
+
+	* bgpd.h: (bgp_peer) add fd_local and fd_accept 
+	  file descriptor's, fd becomes a pointer to one of these.
+	* bgpd.c: (global) adjust for fact that fd is now a pointer.
+	  (peer_create_accept) removed.
+	* bgp_route.c: (global) adjust for change of peer fd to pointer
+	* bgp_packet.c: (bgp_collision_detect) adjust and remove the 
+	  "replace with other peer" hack. 
+	* bgp_network.c: (bgp_accept) Remove the dummy peer hack. 
+	  Update peer->fd_accept instead. 
+	  (global) Adjust fd references - now a pointer.
+	* bgp_fsm.c: (global) adjust peer fd to pointer.
+	  (bgp_connection_stop) new function, to stop connection.
+	  (global) adjust everything which closed peer fd to use
+	  bgp_connection_stop().
+	  
 2003-12-23 Krzysztof Oledzki <oleq@ans.pl>
 
 	* bgp_network.c: drop privs on error cases
 
-2003-08-11 kunihiro <kunihiro@zebra.org
+2003-08-11 kunihiro <kunihiro@zebra.org>
 
 	* bgp_route{,map}.c: Extend 'set ip next-hop' in route-maps with
 	  ability to specify 'peer-address' rather than IP. 
diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c
index 3d8e957..ac25f15 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,6 +307,21 @@
   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)
@@ -367,12 +382,8 @@
     stream_reset (peer->work);
   stream_fifo_clean (peer->obuf);
 
-  /* Close of file descriptor. */
-  if (peer->fd >= 0)
-    {
-      close (peer->fd);
-      peer->fd = -1;
-    }
+  /* Close of connections. */
+  bgp_connection_stop (peer);
 
   /* Connection information. */
   if (peer->su_local)
@@ -386,7 +397,7 @@
       XFREE (MTYPE_SOCKUNION, peer->su_remote);
       peer->su_remote = NULL;
     }
-
+    
   /* Clear remote router-id. */
   peer->remote_id.s_addr = 0;
 
@@ -477,13 +488,13 @@
 int
 bgp_connect_success (struct peer *peer)
 {
-  if (peer->fd < 0)
+  if (peer->fd_local < 0)
     {
       zlog_err ("bgp_connect_success peer's fd is negative value %d",
-		peer->fd);
+                peer->fd_local);
       return -1;
     }
-  BGP_READ_ON (peer->t_read, bgp_read, peer->fd);
+  BGP_READ_ON (peer->t_read, bgp_read, peer->fd_local);
 
   /* bgp_getsockname (peer); */
 
@@ -521,29 +532,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 aa369bc..e03831d 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -46,7 +46,6 @@
   int accept_sock;
   union sockunion su;
   struct peer *peer;
-  struct peer *peer1;
   struct bgp *bgp;
   char buf[SU_ADDRSTRLEN];
 
@@ -73,12 +72,12 @@
     zlog_info ("[Event] BGP connection from host %s", inet_sutop (&su, buf));
   
   /* Check remote IP address */
-  peer1 = peer_lookup (bgp, &su);
-  if (! peer1 || peer1->status == Idle)
+  peer = peer_lookup (bgp, &su);
+  if (! peer || peer->status == Idle)
     {
       if (BGP_DEBUG (events, EVENTS))
 	{
-	  if (! peer1)
+	  if (! peer)
 	    zlog_info ("[Event] BGP connection IP address %s is not configured",
 		       inet_sutop (&su, buf));
 	  else
@@ -90,30 +89,13 @@
     }
 
   /* In case of peer is EBGP, we should set TTL for this connection.  */
-  if (peer_sort (peer1) == BGP_PEER_EBGP)
-    sockopt_ttl (peer1->su.sa.sa_family, bgp_sock, peer1->ttl);
+  if (peer_sort (peer) == BGP_PEER_EBGP)
+    sockopt_ttl (peer->su.sa.sa_family, bgp_sock, peer->ttl);
 
   if (! bgp)
-    bgp = peer1->bgp;
+    bgp = peer->bgp;
 
-  /* 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);
-  }
+  peer->fd_accept = bgp_sock;
 
   BGP_EVENT_ADD (peer, TCP_connection_open);
 
@@ -133,7 +115,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)
     {
@@ -207,12 +189,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.  */
@@ -222,16 +204,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);
@@ -246,10 +228,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. */
@@ -268,8 +250,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 48879f3..7d921be 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,7 +238,6 @@
       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;
     }
@@ -395,7 +394,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
@@ -469,7 +468,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.  */
@@ -575,7 +574,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)
 	{
@@ -645,7 +644,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;
 }
@@ -665,7 +664,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);
@@ -725,7 +724,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. */
@@ -780,7 +779,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. */
@@ -981,7 +980,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. */
@@ -1048,14 +1047,13 @@
     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 *new, struct in_addr remote_id)
+bgp_collision_detect (struct peer *peer, struct in_addr remote_id)
 {
-  struct peer *peer;
   struct listnode *nn;
   struct bgp *bgp;
 
@@ -1076,11 +1074,10 @@
     {
       /* Under OpenConfirm status, local peer structure already hold
          remote router ID. */
-
-      if (peer != new
-	  && (peer->status == OpenConfirm || peer->status == OpenSent)
-	  && sockunion_same (&peer->su, &new->su))
-	{
+      if ((peer->status == OpenConfirm)
+          && ( ntohl(peer->remote_id.s_addr) == ntohl(remote_id.s_addr) )
+         )
+        {
 	  /* 1. The BGP Identifier of the local system is compared to
 	     the BGP Identifier of the remote system (as specified in
 	     the OPEN message). */
@@ -1093,8 +1090,16 @@
 		 already in the OpenConfirm state), and accepts BGP
 		 connection initiated by the remote system. */
 
-	      if (peer->fd >= 0)
-		bgp_notify_send (peer, BGP_NOTIFY_CEASE, 0);
+	      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);
 	      return 1;
 	    }
 	  else
@@ -1105,12 +1110,15 @@
 		 existing one (the one that is already in the
 		 OpenConfirm state). */
 
-	      if (new->fd >= 0)
-		bgp_notify_send (new, BGP_NOTIFY_CEASE, 0);
+	      if (peer->fd_accept >= 0)
+	        {
+	          close (peer->fd_accept);
+	          peer->fd_accept = -1;
+	        }    
 	      return -1;
 	    }
-	}
-    }
+	  }
+    }    
   return 0;
 }
 
@@ -1187,51 +1195,6 @@
   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
@@ -2031,7 +1994,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) 
@@ -2050,7 +2013,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;
     }
@@ -2097,12 +2060,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 f6f0879..1d7a052 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4202,7 +4202,8 @@
 	    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 3a12a27..f4c8f76 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -504,11 +504,10 @@
   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
@@ -684,8 +683,11 @@
   peer = XMALLOC (MTYPE_BGP_PEER, sizeof (struct peer));
   memset (peer, 0, sizeof (struct peer));
 
+  peer->fd = &peer->fd_local;
+
   /* Set default value. */
-  peer->fd = -1;
+  peer->fd_local = -1;
+  peer->fd_accept = -1;
   peer->v_start = BGP_INIT_START_TIMER;
   peer->v_connect = BGP_DEFAULT_CONNECT_RETRY;
   peer->v_asorig = BGP_DEFAULT_ASORIGINATE;
@@ -769,19 +771,6 @@
   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)
@@ -1810,9 +1799,8 @@
   
   LIST_LOOP (bgp->peer, peer, nn)
     {
-      if (sockunion_same (&peer->su, su)
-	  && ! CHECK_FLAG (peer->sflags, PEER_STATUS_ACCEPT_PEER))
-	return peer;
+      if (sockunion_same (&peer->su, su))
+        return peer;
     }
   return NULL;
 }
@@ -1831,27 +1819,25 @@
 
   LIST_LOOP (bgp->peer, peer, nn)
     {
-      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;
-	}
+      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;
+        }
     }
   LIST_LOOP (bgp->peer, peer, nn)
     {
-      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;
-	}
+      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;
+        }
     }
   return NULL;
 }
@@ -2278,22 +2264,24 @@
 
   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;
 }
@@ -2314,22 +2302,24 @@
 
   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 498bd07..a8bfa52 100644
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
@@ -256,27 +256,29 @@
   int ostatus;
 
   /* Peer information */
-  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 */
+  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 */
   
-  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. */
+  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. */
 
-  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];
