From owner-freebsd-questions Tue Nov 9 6:17: 5 1999 Delivered-To: freebsd-questions@freebsd.org Received: from dns.ie-online.it (dns.ie-online.it [194.133.148.8]) by hub.freebsd.org (Postfix) with ESMTP id B890914E24 for ; Tue, 9 Nov 1999 06:16:51 -0800 (PST) (envelope-from sriva@alice.it) Received: from attila.ie-interna.it (host1.ie-online.it [194.133.148.10]) by dns.ie-online.it (8.8.8/8.8.8) with ESMTP id PAA13849 for ; Tue, 9 Nov 1999 15:16:50 +0100 (CET) (envelope-from sriva@alice.it) Received: from stefano (stefano.ie-interna.it [192.168.0.33]) by attila.ie-interna.it (8.9.3/8.9.3) with SMTP id PAA53832 for ; Tue, 9 Nov 1999 15:16:49 +0100 (CET) (envelope-from sriva@alice.it) Message-Id: <3.0.5.32.19991109151648.00ac7100@relay.alice.it> X-Sender: riva@relay.alice.it X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Tue, 09 Nov 1999 15:16:48 +0100 To: freebsd-questions@FreeBSD.ORG From: Stefano Riva Subject: Strange pppd behaviour - tcsetattr() Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I'm using a FreeBSD box as access server to connect to my office's private network from home. It worked very well for more than one year with 2.2.7-RELEASE. Recently I've upgraded to 3.3-STABLE (fresh installation of 3.3-RELEASE, then 3.3-STABLE). Same configuration. Version of pppd is 2.3.5 (of course). The server listen to cuaa0 with mgetty. There's a "ppp" user with a script called "ppplogin" for shell. The script checks if the current tty is suitable for PPP connection (I've another modem attached to cuaa1, for example, but I don't want PPP connections through that modem; so if tty isn't cuaa0 the script prints a warning and aborts), then: /usr/bin/mesg n /bin/stty -tostop /usr/bin/pppd proxyarp Usually it works. Sometime it doesn't; pppd aborts logging "tcsetattr: Input/output error". There isn't a specific rule, as far as I can see. You call for, let's say, 10 times without problems, then the problem appears. When pppd aborts, I have to reboot or to wait for some time for it to work again. I browsed the pppd sources. The tcsetattr() call that fails is in sys-bsd.c (line 429), action TCSAFLUSH, when pppd configures the serial port. I tried to replace TCSAFLUSH with TCSANOW. It seems to work flawlessly. I guessed that tcsetattr() can have some problem emptying the output buffer. I tried to put a sleep before pppd in my ppplogin script, returning to the original pppd. Again, it seems to work flawlessly. Am I missing something here? The kernel configuration has nothing unusual... --- Stefano Riva Systems & Network Administrator Informazioni Editoriali I.E. Srl Voice +39-02283151, Fax +39-0228315900 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message