From nobody@FreeBSD.ORG Sun May 30 07:12:40 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 068F614CCE; Sun, 30 May 1999 07:12:39 -0700 (PDT)
Message-Id: <19990530141239.068F614CCE@hub.freebsd.org>
Date: Sun, 30 May 1999 07:12:39 -0700 (PDT)
From: plm@xs4all.nl
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: pppd connection time report is wrong
X-Send-Pr-Version: www-1.0

>Number:         11943
>Category:       bin
>Synopsis:       pppd connection time report is wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    brian
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 30 07:20:01 PDT 1999
>Closed-Date:    Thu Jun 17 15:13:25 PDT 1999
>Last-Modified:  Thu Jun 17 15:13:59 PDT 1999
>Originator:     Peter Mutsaers
>Release:        -current of may 12th 1999
>Organization:
n.a.
>Environment:
FreeBSD muon 4.0-CURRENT FreeBSD 4.0-CURRENT #40: Tue May 11 22:12:00 MET DST 1999     plm@muon:/var/arch/fbsd/src/sys/compile/PLM  i386
>Description:
Via syslog/debug.notice pppd reports how long it has been connected 
when the link is shutdown (idle).

When the link is shutdown it reports e.g. 65 minutes connected time when
in fact it was only 4 minutes. This occurs when using dial-on-demand.
>How-To-Repeat:
Start pppd client connection via dial on demand, then shut it down or wait until the idle
timer expires
>Fix:
In main.c: stime (start time) is set when pppd starts. It should be
set when the connecion fires up instead:

*** main.c-     Sun May 30 16:05:46 1999
--- main.c      Sun May 30 16:07:23 1999
***************
*** 548,553 ****
--- 548,554 ----
         * incoming events (reply, timeout, etc.).
         */
        syslog(LOG_NOTICE, "Connect: %s <--> %s", ifname, devnam);
+       stime = time((time_t *) NULL);
        lcp_lowerup(0);
        lcp_open(0);            /* Start protocol */
        for (phase = PHASE_ESTABLISH; phase != PHASE_DEAD; ) {


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->obrien 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Jun 8 03:36:56 PDT 1999 
Responsible-Changed-Why:  
Pppd is very much David's baby. :-) 
Responsible-Changed-From-To: obrien->freebsd-bugs 
Responsible-Changed-By: obrien 
Responsible-Changed-When: Wed Jun 16 09:56:27 PDT 1999 
Responsible-Changed-Why:  
David does Amd, DHCP(client), and EGCS.  He doesn't know much about PPP and 
hasn't used PPP (in any form) for 2.5 years. 
. 
Responsible-Changed-From-To: freebsd-bugs->brian 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Thu Jun 17 00:55:46 PDT 1999 
Responsible-Changed-Why:  
Brian Somers is the PPP man. Silly me. 
State-Changed-From-To: open->closed 
State-Changed-By: brian 
State-Changed-When: Thu Jun 17 15:13:25 PDT 1999 
State-Changed-Why:  
Patch applied to -current 
>Unformatted:
