From 322e6d68a1737fbbd563030ba33c8498f34fabe0 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Fri, 31 Dec 2004 11:58:56 +0000 Subject: [PATCH] Call lcp_close(0) in link_required if the channel connect or establish_ppp functions fail. It's a bit grotty but it is needed to get lcp back into closed state so that a future lcp_open will do what it should. --- pppd/auth.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pppd/auth.c b/pppd/auth.c index 8a8b2fb..f34be0e 100644 --- a/pppd/auth.c +++ b/pppd/auth.c @@ -68,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: auth.c,v 1.101 2004/11/12 10:30:51 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.102 2004/12/31 11:58:56 paulus Exp $" #include #include @@ -532,9 +532,12 @@ void link_required(unit) int unit; { + char *msg; + new_phase(PHASE_SERIALCONN); devfd = the_channel->connect(); + msg = "Connect script failed"; if (devfd < 0) goto fail; @@ -547,6 +550,7 @@ link_required(unit) * gives us. Thus we don't need the tdb_writelock/tdb_writeunlock. */ fd_ppp = the_channel->establish_ppp(devfd); + msg = "ppp establishment failed"; if (fd_ppp < 0) { status = EXIT_FATAL_ERROR; goto disconnect; @@ -581,6 +585,8 @@ link_required(unit) if (the_channel->cleanup) (*the_channel->cleanup)(); + /* XXX not nice here but needs to go somewhere... */ + lcp_close(0, msg); } /* -- 2.39.2