From richard@trltech.co.uk Thu Jun 10 06:59:20 1999
Return-Path: <richard@trltech.co.uk>
Received: from ns.wan (trltech.demon.co.uk [194.222.7.191])
	by hub.freebsd.org (Postfix) with ESMTP id 5318E14FC0
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 10 Jun 1999 06:59:05 -0700 (PDT)
	(envelope-from richard@trltech.co.uk)
Received: from rdls.sw.wan (rdls.sw.wan [192.9.200.19])
	by ns.wan (8.9.2/8.9.2) with ESMTP id OAA01086
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 10 Jun 1999 14:58:52 +0100 (BST)
	(envelope-from richard@trltech.co.uk)
Received: (from richard@localhost)
	by rdls.sw.wan (8.9.2/8.9.2) id OAA01338;
	Thu, 10 Jun 1999 14:57:35 +0100 (BST)
	(envelope-from richard)
Message-Id: <199906101357.OAA01338@rdls.sw.wan>
Date: Thu, 10 Jun 1999 14:57:35 +0100 (BST)
From: rsmith@trltech.co.uk
Sender: richard@trltech.co.uk
Reply-To: richard@jezebel.demon.co.uk
To: FreeBSD-gnats-submit@freebsd.org
Subject: pppd reports wrong connected duration with demand option
X-Send-Pr-Version: 3.2

>Number:         12115
>Category:       bin
>Synopsis:       pppd reports wrong connected duration with demand option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 10 07:00:01 PDT 1999
>Closed-Date:    Thu Jun 14 21:40:57 PDT 2001
>Last-Modified:  Thu Jun 14 21:42:30 PDT 2001
>Originator:     Richard Smith
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
TRL Technology Ltd
>Environment:

FreeBSD ns.wan 3.1-RELEASE FreeBSD 3.1-RELEASE #0: Thu Jun  3 16:11:34 BST 1999     richard@ns2.wan:/usr/src/sys/compile/GATEKEEPER  i386

>Description:

Using pppd for dial-on-demand over a dial-up ISDN line to our ISP. Whenever the line drops, pppd reports the connected duration in minutes using syslog(3), priority LOG_NOTICE. Unfortunately pppd calculates the duration from when pppd was started, not from when the line went up.

>How-To-Repeat:

Add the 'demand' keyword to the /etc/ppp/options file.

>Fix:

*** main.c.original     Wed Jun  2 14:32:49 1999
--- main.c      Wed Jun  2 14:59:51 1999
***************
*** 509,514 ****
--- 509,521 ----
            close(i);
        }
  
+       if (demand) {
+           /*
+            * dial-on-demand: connected time starts now
+            */
+           stime = time((time_t *) NULL);
+       }
+ 
        /* run welcome script, if any */
        if (welcomer && welcomer[0]) {
            if (device_script(welcomer, ttyfd, ttyfd) < 0)


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Thu Jun 14 21:40:57 PDT 2001 
State-Changed-Why:  
Fixed, duplicate of PR 11943. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=12115 
>Unformatted:
