[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Local interface used for outbound network connections
From: |
Richard Stallman |
Subject: |
Re: Local interface used for outbound network connections |
Date: |
Thu, 09 Jan 2003 02:28:21 -0500 |
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");