From: "peter@endian.com" Date: Wed, 25 Jan 2012 19:14:26 +0100 Subject: [PATCH] dont-exit-pado-timeout To: ppp-bugs@ppp.samba.org Subject: using rp-pppoe pppd exits with EXIT_OK after receiving a timeout waiting for PADO due to no modem attached Date: Mon, 17 Nov 2008 19:46:54 +0000 (GMT) Full_Name: Peter Warasin Version: 2.4.4 OS: linux 2.6.22.19 Submission from: (NULL) (217.133.34.27) 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: --- pppd/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pppd/auth.c b/pppd/auth.c index fb71944..031c030 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -555,6 +555,7 @@ void start_link(unit) { char *msg; + status = EXIT_NEGOTIATION_FAILED; new_phase(PHASE_SERIALCONN); hungup = 0; @@ -591,7 +592,6 @@ void start_link(unit) notice("Starting negotiation on %s", ppp_devnam); add_fd(fd_ppp); - status = EXIT_NEGOTIATION_FAILED; new_phase(PHASE_ESTABLISH); lcp_lowerup(0);