unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: 34617@debbugs.gnu.org
Subject: bug#34617: 27.0.50; Can't bind a server process to all interfaces?
Date: Fri, 22 Feb 2019 14:43:48 +0100	[thread overview]
Message-ID: <m3d0nk546j.fsf@gnus.org> (raw)


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






             reply	other threads:[~2019-02-22 13:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 13:43 Lars Ingebrigtsen [this message]
2019-02-22 13:51 ` bug#34617: 27.0.50; Can't bind a server process to all interfaces? 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3d0nk546j.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=34617@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).