From owner-freebsd-net Mon Oct 11 23:53: 6 1999 Delivered-To: freebsd-net@freebsd.org Received: from storm.FreeBSD.org.uk (storm.freebsd.org.uk [194.242.128.198]) by hub.freebsd.org (Postfix) with ESMTP id D60A614A2F for ; Mon, 11 Oct 1999 23:53:02 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@localhost [127.0.0.1]) by storm.FreeBSD.org.uk (8.9.3/8.9.3) with ESMTP id HAA88948; Tue, 12 Oct 1999 07:52:46 +0100 (BST) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost.lan.Awfulhak.org [127.0.0.1]) by hak.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id HAA00670; Tue, 12 Oct 1999 07:20:47 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <199910120620.HAA00670@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.0.2 2/24/98 To: Christopher Masto , freebsd-net@FreeBSD.ORG Cc: Brian Somers , Ernie Elu Subject: Re: Modem race with Multilink PPP - what does POSIX say ? In-reply-to: Your message of "Mon, 11 Oct 1999 20:18:01 EDT." <19991011201800.A11154@netmonger.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 12 Oct 1999 07:20:47 +0100 From: Brian Somers Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > 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 Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message