summaryrefslogtreecommitdiffstats
path: root/patches/ppp-2.4.5/0006-dont-exit-pado-timeout.patch
blob: 7791a1cab602a2c63bb9764bda819fe293507608 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From: "peter@endian.com" <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);