From owner-freebsd-current Thu Sep 11 02:57:00 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id CAA11282 for current-outgoing; Thu, 11 Sep 1997 02:57:00 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id CAA11277 for ; Thu, 11 Sep 1997 02:56:56 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.5/8.6.9) id TAA04606; Thu, 11 Sep 1997 19:54:49 +1000 Date: Thu, 11 Sep 1997 19:54:49 +1000 From: Bruce Evans Message-Id: <199709110954.TAA04606@godzilla.zeta.org.au> To: ache@nagual.pp.ru, bde@zeta.org.au Subject: Re: PPP - why set CLOCAL for server ('-direct' mode) ? Cc: current@FreeBSD.ORG, nnd@itfs.nsk.su Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Bruce, ppp -direct NOT supposed to track carrier because it uses pure >stdin/stdout as controlling terminal. I can be even file, so TIOCM_CD is >impossible. It is upper leve task to track/handle all device specific It would take a strange input file to work with ppp. Anyway, in the usual (isatty(0)) case for -direct, `modem' is `open(ctermid(NULL), O_RDWR | O_NONBLOCK). This is essentially the same as for the usual !-direct case where `modem' is `open(VarDevice, O_RDWR | O_NONBLOCK). The main point of opening another device instance seems to be to avoid closing everything when `modem' is closed, but this is perfectly broken for the hangup case - setting CLOCAL prevents normal hangup processing and exiting from ppp may leave stdin open on a dead modem. In practice, it shouldn't be that bad. ppp should restore the termios state before exiting, and FreeBSD will notice that the connection has dropped when CLOCAL is turned off. It isn't clear whether this FreeBSD beviour is required by POSIX. Bruce