From d4978210f0cf54109c4d1030be1eb289e4c75b39 Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Thu, 17 May 2012 15:56:35 +0200 Subject: [PATCH] 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: --- src/netif/ppp/auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netif/ppp/auth.c b/src/netif/ppp/auth.c index 9e105c0a..f54e4925 100644 --- a/src/netif/ppp/auth.c +++ b/src/netif/ppp/auth.c @@ -559,6 +559,7 @@ void start_link(unit) { char *msg; + status = EXIT_NEGOTIATION_FAILED; new_phase(PHASE_SERIALCONN); hungup = 0; @@ -595,7 +596,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);