Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 1999 07:20:47 +0100
From:      Brian Somers <brian@Awfulhak.org>
To:        Christopher Masto <chris@netmonger.net>, freebsd-net@FreeBSD.ORG
Cc:        Brian Somers <brian@Awfulhak.org>, Ernie Elu <ernie@spooky.eis.net.au>
Subject:   Re: Modem race with Multilink PPP - what does POSIX say ?
Message-ID:  <199910120620.HAA00670@hak.lan.Awfulhak.org>
In-Reply-To: Your message of "Mon, 11 Oct 1999 20:18:01 EDT." <19991011201800.A11154@netmonger.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, Oct 11, 1999 at 01:46:16AM +0100, Brian Somers wrote:
> > This is a known problem (well, to me anyway).
> > 
> > Ppp will attempt to bind() a local domain socket when MP is 
> > established.  If bind() fails, it'll try to connect(), otherwise 
> > it'll try to listen().  If two processes are doing this at the same 
> > time, one bind() succeeds, but the connect() of the failed process 
> > happens before the servers listen() and fails :-(
> 
> IDKWITA, but from experimentation, the connect() should block for a
> while and succeed shortly after the other process calls listen().
> -- 
> Christopher Masto         Senior Network Monkey      NetMonger Communications
> chris@netmonger.net        info@netmonger.net        http://www.netmonger.net
> 
> Free yourself, free your machine, free the daemon -- http://www.freebsd.org/
[.....]

All very well, but in ppp(8)s case, this means that I need a new 
datalink state in between lcp and open so that I can go off and deal 
with more urgent things....  This is non-trivial and a PITA.  It's 
also pretty cruddy and unreliable IMHO.

The real way forward would be to have a different errno coming back 
from connect() - something like EAGAIN rather ECONREFUSED when the 
socket is bound but not listening.  This would be a double bonus 
because I'd then be able to identify stale local domain sockets.

Anybody know what POSIX says on along these lines ?

Cheers.

-- 
Brian <brian@Awfulhak.org>                        <brian@FreeBSD.org>
      <http://www.Awfulhak.org>;                   <brian@OpenBSD.org>
Don't _EVER_ lose your sense of humour !          <brian@FreeBSD.org.uk>




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




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