Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #226483

Re: Cannot see a process listening on 127.0.0.1

From Victor Sudakov <vas@sibptus.ru>
Newsgroups linux.debian.user
Subject Re: Cannot see a process listening on 127.0.0.1
Date 2020-08-25 05:40 +0200
Message-ID <AHxYt-3hl-3@gated-at.bofh.it> (permalink)
References <AFLjb-42c-5@gated-at.bofh.it> <AFSaZ-81y-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Andy Smith wrote:
> 
> On Thu, Aug 20, 2020 at 12:09:03PM +0700, Victor Sudakov wrote:
> > There is a process listening on 127.0.0.1:8081 but for some reason
> > netstat/sockstat/ss do not show it listening on IPv4. Is this a bug or a
> > feature?
> 
> I think it's listening on an IPv4-mapped IPv6 address so it can
> accept either v4 or v6. Does this answer your question?
> 
>     https://unix.stackexchange.com/questions/152612/netstat-why-are-ipv4-daemons-listening-to-ports-listed-only-in-a-inet6
> 
> Daemons that want to receive connections will do the equivalent of:
> 
>     bind(address, port)
> 
> The address will determine the interface and whether it is v4 or v6
> or whatever. If they instead do:
> 
>     bind(INADDR_ANY, port)
> 
> then this will bind to every interface whether it's v4 or v6 and the
> daemon will get udp6 or tcp6 sockets that can from fromn/to a v4 address.

Thank you, Andy, that explains it. 

It's different in *BSD which got me confused. In *BSD, even if you bind
to INADDR_ANY, you'll see something like this in sockstat output:

root     dovecot    39601 21 tcp4   *:110                 *:*
root     dovecot    39601 22 tcp6   *:110                 *:*
root     dovecot    39601 23 tcp4   *:995                 *:*
root     dovecot    39601 24 tcp6   *:995                 *:*

-- 
Victor Sudakov,  VAS4-RIPE, VAS47-RIPN
2:5005/49@fidonet http://vas.tomsk.ru/

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-20 07:30 +0200
  Re: Cannot see a process listening on 127.0.0.1 Dan Ritter <dsr@randomstring.org> - 2020-08-20 13:00 +0200
    Re: Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-20 13:10 +0200
      Re: Cannot see a process listening on 127.0.0.1 Dan Ritter <dsr@randomstring.org> - 2020-08-20 13:20 +0200
        Fw: Cannot see a process listening on 127.0.0.1 Matthew Campbell <trenix25@pm.me> - 2020-08-20 14:40 +0200
  Re: Cannot see a process listening on 127.0.0.1 Andy Smith <andy@strugglers.net> - 2020-08-20 14:50 +0200
    Re: Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-25 05:40 +0200
      Re: Cannot see a process listening on 127.0.0.1 Anssi Saari <as@sci.fi> - 2020-08-25 10:20 +0200
        Re: Cannot see a process listening on 127.0.0.1 Victor Sudakov <vas@sibptus.ru> - 2020-08-26 04:20 +0200

csiph-web