Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jun 2020 12:02:44 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Michael Tuexen <tuexen@freebsd.org>
Cc:        "bergerkos@yahoo.co.uk" <bergerkos@yahoo.co.uk>, "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: =?koi8-r?Q?=F7?= =?koi8-r?Q?_=CF=D4=D7=C5=D4?= =?koi8-r?Q?_=CE=C1=3A?= vnc can't connect to socket
Message-ID:  <8899ab009f5a2d6fca0cebd53913ca03a48f4861.camel@freebsd.org>
In-Reply-To: <E9CA2FDE-0F7E-47C8-BB3B-F00F2E471DF3@freebsd.org>
References:  <1559644055.2429905.1592721641280.ref@mail.yahoo.com> <1559644055.2429905.1592721641280@mail.yahoo.com> <1749874720.2583691.1592742539717@mail.yahoo.com> <5035A0D1-BF25-4483-BD52-75944EBBEF8E@freebsd.org> <ae6c2e2856e1e7193026c01821571d7f17e3d0f5.camel@freebsd.org> <E9CA2FDE-0F7E-47C8-BB3B-F00F2E471DF3@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2020-06-21 at 19:54 +0200, Michael Tuexen wrote:
> > On 21. Jun 2020, at 19:40, Ian Lepore <ian@freebsd.org> wrote:
> > 
> > On Sun, 2020-06-21 at 14:54 +0200, Michael Tuexen wrote:
> > > > On 21. Jun 2020, at 14:28, Kostya Berger <bergerkos@yahoo.co.uk
> > > > >
> > > > wrote:
> > > > 
> > > > Ok, it turns out, it gives the previously mentioned error only
> > > > if I
> > > > use VNC server string 0.0.0.0:5900 (as I always did). in my VNC
> > > > client.But when replaced with127.0.0.1:5900it connects all
> > > > right.
> > > 
> > > I don't hink 0.0.0.0 is a valid destination address you can use
> > > in
> > > connect(). Using 127.0.0.1 should
> > > be fine.
> > > 
> > > I guess, https://svnweb.freebsd.org/changeset/base/361752 is the
> > > relevant commit here.
> > > 
> > 
> > *BSD has always accepted 0 as a synonym for localhost (and iirc, linux
> > does not).  If this no longer works, it's a regression which is going
> > to cause existing applications and scripts to fail.  At the very least
> > it deserves an entry in UPDATING.
> 
> Hmm. 0.0.0.0 is a wildcard address, meaning any of my local addresses.
> I do understand how that works for binding a TCP socket you will be
> listening on. It just means accept TCP connections on all addresses.
> The destination address of the incoming SYN segment will determine which
> one to use. However, which of the local addresses should be used
> when calling connect() with 0.0.0.0? How should this choice be made?
> 
> Best regards
> Michael
> 

I don't know.  I had thought the idea was sanctioned by a couple RFCs,
but I just had a fresh look at them (1122, 5735) and it now appears to
me that in both cases it sanctions using 0.0.0.0 as a source address,
but not as a destination.  So now I'm thinking maybe it has been a
historical mistake amongst the BSDs to accept it as a destination
address synonym for 127.0.0.1.

I was mostly just pointing out this change to no longer accept it is
going to be a big surprise to many people when it hits the streets in a
release.  I know it's going to break things at $work, we'll have to
start combing around for uses of it and make changes.  (Fixing my 20+
years of finger-memory for "nc 0 <someport>" will be harder.)

-- Ian





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8899ab009f5a2d6fca0cebd53913ca03a48f4861.camel>