ppp-project/ppp

Blocking pppd on restore_tty function

tdolata opened this issue · 2 comments

With the hardware flow control option active and in if the modem is not properly connected (or missing).
In this case, the chat blocks on sending the first AT command, then the chat terminates with an error after receiving a SIGALARM.
The pppd detects an invalid chat termination and attempts to restore the saved tty settings in the restore_tty function.
Unfortunately, the tcsetattr function is called with the TCSAFLUSH flag, this causes the program to wait for the transmit buffer to empty, which never happens.
The solution is to change the flag to TCSANOW or to call the tcflush function previously.

@paulusmack, @enaess: Have you seen this ticket?

I think calling tcflush in restore_tty is reasonable.