using rp-pppoe pppd exits with EXIT_OK after receiving a timeout waiting for PADO due to no modem attached, from Debian patches

http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=2211

Using rp-pppoe pppd exits with exitcode 0, whenever there is no modem connected
and pppd get's a timeout while waiting for a PADO.

This happens because status is set to EXIT_OK in main.c at the beginning of the
procedures. Within start_link(), connect() will be called as one of the first
calls.
If that call fails (no pppoe discovery for example), jumps to "fail", which
returns without setting the status variable to failure. So at the end pppd exits
with EXIT_OK.

I moved the status = EXIT_NEGOTIATION_FAILED which will be set later within
start_link, at the top of it. That seems to work out, patch is attached:
This commit is contained in:
Sylvain Rochet 2012-05-17 15:56:35 +02:00
parent ef59e952d8
commit d4978210f0

View File

@ -559,6 +559,7 @@ void start_link(unit)
{ {
char *msg; char *msg;
status = EXIT_NEGOTIATION_FAILED;
new_phase(PHASE_SERIALCONN); new_phase(PHASE_SERIALCONN);
hungup = 0; hungup = 0;
@ -595,7 +596,6 @@ void start_link(unit)
notice("Starting negotiation on %s", ppp_devnam); notice("Starting negotiation on %s", ppp_devnam);
add_fd(fd_ppp); add_fd(fd_ppp);
status = EXIT_NEGOTIATION_FAILED;
new_phase(PHASE_ESTABLISH); new_phase(PHASE_ESTABLISH);
lcp_lowerup(0); lcp_lowerup(0);