From owner-freebsd-bugs Thu Jun 10 7: 0: 6 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 15C8214FD3 for ; Thu, 10 Jun 1999 07:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA23820; Thu, 10 Jun 1999 07:00:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from ns.wan (trltech.demon.co.uk [194.222.7.191]) by hub.freebsd.org (Postfix) with ESMTP id 5318E14FC0 for ; 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 ; 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 Reply-To: richard@jezebel.demon.co.uk To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/12115: pppd reports wrong connected duration with demand option Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 12115 >Category: bin >Synopsis: pppd reports wrong connected duration with demand option >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jun 10 07:00:01 PDT 1999 >Closed-Date: >Last-Modified: >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: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message