From: Paul Mackerras Date: Tue, 12 Jul 2005 01:07:59 +0000 (+0000) Subject: Bring up the link on an explicit call from main() rather than X-Git-Tag: ppp-2.4.7~145 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=bc3775fa3f711516fbd0890035a8ddc145ad2ff0 Bring up the link on an explicit call from main() rather than doing it in link_required(). With the old way, it was restarting the link in the middle of link_terminated(). --- diff --git a/pppd/auth.c b/pppd/auth.c index 92fe82d..e435e6c 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.104 2005/07/09 05:49:44 paulus Exp $" +#define RCSID "$Id: auth.c,v 1.105 2005/07/12 01:07:59 paulus Exp $" #include #include @@ -526,11 +526,18 @@ set_permitted_number(argv) /* * An Open on LCP has requested a change from Dead to Establish phase. - * Do what's necessary to bring the physical layer up. */ void link_required(unit) int unit; +{ +} + +/* + * Bring the link up to the point of being able to do ppp. + */ +void start_link(unit) + int unit; { char *msg; diff --git a/pppd/main.c b/pppd/main.c index b5702f2..be212da 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -66,7 +66,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: main.c,v 1.150 2005/03/21 09:20:16 paulus Exp $" +#define RCSID "$Id: main.c,v 1.151 2005/07/12 01:07:59 paulus Exp $" #include #include @@ -534,6 +534,7 @@ main(argc, argv) script_unsetenv("BYTES_RCVD"); lcp_open(0); /* Start protocol */ + start_link(0); while (phase != PHASE_DEAD) { handle_events(); get_input(); diff --git a/pppd/pppd.h b/pppd/pppd.h index deab65a..3a95d35 100644 --- a/pppd/pppd.h +++ b/pppd/pppd.h @@ -39,7 +39,7 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: pppd.h,v 1.89 2004/11/14 22:53:42 carlsonj Exp $ + * $Id: pppd.h,v 1.90 2005/07/12 01:07:59 paulus Exp $ */ /* @@ -525,6 +525,7 @@ ssize_t complete_read __P((int, void *, size_t)); /* Procedures exported from auth.c */ void link_required __P((int)); /* we are starting to use the link */ +void start_link __P((int)); /* bring the link up now */ void link_terminated __P((int)); /* we are finished with the link */ void link_down __P((int)); /* the LCP layer has left the Opened state */ void upper_layers_down __P((int));/* take all NCPs down */