unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34617: 27.0.50; Can't bind a server process to all interfaces?
@ 2019-02-22 13:43 Lars Ingebrigtsen
  2019-02-22 13:51 ` Lars Ingebrigtsen
  2019-02-22 14:00 ` Robert Pluim
  0 siblings, 2 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2019-02-22 13:43 UTC (permalink / raw)
  To: 34617


I'm looking to bind a server process to all interfaces on the machine.
If I say:

		(make-network-process
		 :name name
		 :family 'ipv4
		 :service port
		 :host (system-name)
		 :server t))

then the process won't be listening to the localhost address, and if I
say :host nil, it'll only be listening to the localhost address.

Am I missing something, or does Emacs just not have a way to listen to
INADDR_ANY?

The code in make-network-process seems to imply that (and could probably
do with a slight rewrite):

  /* :host HOST -- hostname, ip address, or 'local for localhost.  */
  host = Fplist_get (contact, QChost);
  if (NILP (host))
    {
      /* The "connection" function gets it bind info from the address we're
	 given, so use this dummy address if nothing is specified. */
#ifdef HAVE_LOCAL_SOCKETS
      if (family != AF_LOCAL)
#endif
        {
        if (family == AF_INET6)
          host = build_string ("::1");
        else
          host = build_string ("127.0.0.1");
        }
    }
  else
    {
      if (EQ (host, Qlocal))
        {
	/* Depending on setup, "localhost" may map to different IPv4 and/or
	   IPv6 addresses, so it's better to be explicit (Bug#6781).  */
        if (family == AF_INET6)
          host = build_string ("::1");
        else
          host = build_string ("127.0.0.1");
        }
      CHECK_STRING (host);
    }



In GNU Emacs 27.0.50 (build 62, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2019-02-11 built on stories
Repository revision: 2860f6cec56b02120b0b62cb3733c00a9e5359db
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.11902000
System Description: Debian GNU/Linux 9 (stretch)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-09-21  8:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-22 13:43 bug#34617: 27.0.50; Can't bind a server process to all interfaces? Lars Ingebrigtsen
2019-02-22 13:51 ` Lars Ingebrigtsen
2019-02-22 14:05   ` Lars Ingebrigtsen
2019-02-22 14:25     ` Robert Pluim
2019-02-22 14:28       ` Lars Ingebrigtsen
2019-02-22 15:39         ` Robert Pluim
2019-09-21  8:00       ` Lars Ingebrigtsen
2019-02-22 14:00 ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).