From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Local interface used for outbound network connections Date: Thu, 09 Jan 2003 02:28:21 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <87ptr81sye.fsf@lexx.delysid.org> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1042097671 1828 80.91.224.249 (9 Jan 2003 07:34:31 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 9 Jan 2003 07:34:31 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18WXCv-0000TK-00 for ; Thu, 09 Jan 2003 08:34:29 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18WXIM-00071J-00 for ; Thu, 09 Jan 2003 08:40:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WXCk-0000QG-02 for emacs-devel@quimby.gnus.org; Thu, 09 Jan 2003 02:34:18 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18WXCL-0000La-00 for emacs-devel@gnu.org; Thu, 09 Jan 2003 02:33:53 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18WX84-0006DU-00 for emacs-devel@gnu.org; Thu, 09 Jan 2003 02:29:29 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18WX75-00065E-00 for emacs-devel@gnu.org; Thu, 09 Jan 2003 02:28:27 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.10) id 18WX6z-0001aA-00; Thu, 09 Jan 2003 02:28:21 -0500 Original-To: mlang@delysid.org In-reply-to: <87ptr81sye.fsf@lexx.delysid.org> (message from Mario Lang on Tue, 07 Jan 2003 23:43:53 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10600 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10600 The change looks clean to me. Would someone please install it? *** process.c.~1.388.~ Mon Nov 18 16:40:06 2002 --- process.c Tue Jan 7 23:26:29 2003 *************** *** 130,136 **** Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; Lisp_Object Qlocal, Qdatagram; Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype; ! Lisp_Object QClocal, QCremote, QCcoding; Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; Lisp_Object QCsentinel, QClog, QCoptions; Lisp_Object Qlast_nonmenu_event; --- 130,136 ---- Lisp_Object Qopen, Qclosed, Qconnect, Qfailed, Qlisten; Lisp_Object Qlocal, Qdatagram; Lisp_Object QCname, QCbuffer, QChost, QCservice, QCtype; ! Lisp_Object QCiface, QClocal, QCremote, QCcoding; Lisp_Object QCserver, QCnowait, QCnoquery, QCstop; Lisp_Object QCsentinel, QClog, QCoptions; Lisp_Object Qlast_nonmenu_event; *************** *** 3066,3071 **** --- 3066,3085 ---- #endif contact = Fplist_put (contact, QCaddress, conv_sockaddr_to_lisp (lres->ai_addr, lres->ai_addrlen)); + #ifdef HAVE_GETSOCKNAME + /* Record the address info returned by getsockname + if (socktype == SOCK_STREAM && !is_server) + { + struct sockaddr_in sa1; + int len1 = sizeof (sa1); + if (getsockname (s, (struct sockaddr *)&sa1, &len1) == 0) + { + contact = + Fplist_put (contact, QCiface, + conv_sockaddr_to_lisp (&sa1, len1)); + } + } + #endif } #ifdef HAVE_GETADDRINFO *************** *** 6261,6266 **** --- 6275,6282 ---- staticpro (&QCtype); QClocal = intern (":local"); staticpro (&QClocal); + QCiface = intern (":iface"); + staticpro (&QCiface); QCremote = intern (":remote"); staticpro (&QCremote); QCcoding = intern (":coding");