changeset 49111:32c767302a23

(server_accept_connection): Fixed recording of new connection's local address in :local property of contact info. (Fmake_network_process): Record local network address for new client processes in :local property of contact info.
author Kim F. Storm <storm@cua.dk>
date Wed, 08 Jan 2003 10:38:06 +0000
parents 756931f84374
children 1e2726da986c
files src/process.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Wed Jan 08 10:13:57 2003 +0000
+++ b/src/process.c	Wed Jan 08 10:38:06 2003 +0000
@@ -3066,6 +3066,16 @@
 #endif
       contact = Fplist_put (contact, QCaddress, 
 			    conv_sockaddr_to_lisp (lres->ai_addr, lres->ai_addrlen));
+#ifdef HAVE_GETSOCKNAME
+      if (!is_server)
+	{
+	  struct sockaddr_in sa1;
+	  int len1 = sizeof (sa1);
+	  if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0)
+	    contact = Fplist_put (contact, QClocal,
+				  conv_sockaddr_to_lisp (&sa1, len1));
+	}
+#endif
     }
 
 #ifdef HAVE_GETADDRINFO
@@ -3548,7 +3558,7 @@
 			conv_sockaddr_to_lisp (&saddr.sa, len));
 #ifdef HAVE_GETSOCKNAME
   len = sizeof saddr;
-  if (getsockname (channel, &saddr.sa, &len) == 0)
+  if (getsockname (s, &saddr.sa, &len) == 0)
     contact = Fplist_put (contact, QClocal, 
 			  conv_sockaddr_to_lisp (&saddr.sa, len));
 #endif