Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Nov 1999 15:16:48 +0100
From:      Stefano Riva <sriva@alice.it>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Strange pppd behaviour - tcsetattr()
Message-ID:  <3.0.5.32.19991109151648.00ac7100@relay.alice.it>

next in thread | raw e-mail | index | archive | help
  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




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