[pptp-server] GRE error
Hartmann Schaffer
hartmann.schaffer at mikotel.com
Thu Aug 24 15:10:59 CDT 2000
I have noticed quite a number of messages about this problem. I ran into it
myself and dug a little bit into it by running an strace on pptpctrl. It turns
out that the problem appears when ppdp tries to send an error message via
stderr, which is passed from pptpctrl by dup2-ing the slave terminal of the pty.
The same slave terminal is also dup2-ed to stdout (of pppd). When pppd tries to
write to stderr, it blows up with a broken pipe. I strongly suspect that there
is a problem with Unix98 ptys when you have two file descriptors connecting to
the same pty (I was digging around in pppd as well and noticed that they have
special treatment for ptys in quite a number of places, so there must be
something special about them). Unfortunately I have been unable to find any
documentations about the Unix98 ptys, does anybody have any suggestions?
If my suspicion is correct, the best way to deal with it (short of fixing up
ptys if that is possible) to change pptpctrl to open two pty / tty pairs, so
that it can pass two different ttys to pppd on stdout and stderr (maybe a simple
pipe would be good enough for stderr), use select (or poll) to catch the
datastream from pppd, and merge the two streams when sending to the other end of
the connection.
Hartmann Schaffer
Mikotel Networks Inc.
More information about the pptp-server
mailing list