X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fmain.c;h=a09590e9509341cb33cc6955f1163b8c8a5b6e50;hb=e59b06f904eb25935f8223c80bb1f07dab26933e;hp=e0352f02d462726e7ab9e54f75aed64268e58db7;hpb=392a4f54cb25e48eed9cf5443febeeba7eaf7cbc;p=ppp.git diff --git a/pppd/main.c b/pppd/main.c index e0352f0..a09590e 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: main.c,v 1.105 2001/03/12 22:58:59 paulus Exp $" +#define RCSID "$Id: main.c,v 1.107 2001/05/23 03:39:13 paulus Exp $" #include #include @@ -468,7 +468,10 @@ main(argc, argv) * Start opening the connection and wait for * incoming events (reply, timeout, etc.). */ - notice("Connect: %s <--> %s", ifname, ppp_devnam); + if (ifunit >= 0) + notice("Connect: %s <--> %s", ifname, ppp_devnam); + else + notice("Starting negotiation on %s", ppp_devnam); gettimeofday(&start_time, NULL); link_stats_valid = 0; script_unsetenv("CONNECT_TIME"); @@ -942,14 +945,13 @@ get_input() return; } - if (debug /*&& (debugflags & DBG_INPACKET)*/) - dbglog("rcvd %P", p, len); - if (len < PPP_HDRLEN) { - MAINDEBUG(("io(): Received short packet.")); + dbglog("received short packet:%.*B", len, p); return; } + dump_packet("rcvd", p, len); + p += 2; /* Skip address and control */ GETSHORT(protocol, p); len -= PPP_HDRLEN; @@ -1087,9 +1089,6 @@ static struct timeval timenow; /* Current time */ /* * timeout - Schedule a timeout. - * - * Note that this timeout takes the number of milliseconds, NOT hz (as in - * the kernel). */ void timeout(func, arg, secs, usecs) @@ -1098,10 +1097,10 @@ timeout(func, arg, secs, usecs) int secs, usecs; { struct callout *newp, *p, **pp; - + MAINDEBUG(("Timeout %p:%p in %d.%03d seconds.", func, arg, - time / 1000, time % 1000)); - + secs, usecs/1000)); + /* * Allocate timeout. */