Subject: kern/1493: Kernel PPP driver does not update some statistics fields
To: None <gnats-bugs@gnats.netbsd.org>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 09/21/1995 19:36:17
>Number: 1493
>Category: kern
>Synopsis: Kernel PPP driver does not update some statistics fields
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people (Kernel Bug People)
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Sep 21 22:50:01 1995
>Last-Modified:
>Originator: Thorsten Lockert
>Organization:
SigmaSoft, Th. Lockert
>Release: August 18th, 1995
>Environment:
System: NetBSD gandalf.sigmasoft.com 1.0A NetBSD 1.0A (GANDALF) #0: Thu Jul 6 14:32:54 PDT 1995 tholo@gandalf.sigmasoft.com:/usr/src/sys/arch/i386/compile/GANDALF i386
>Description:
The kernel PPP driver does not update some of the statistics
fields kept for interfaces.
>How-To-Repeat:
Examine the fields
if_baudrate
if_lastchange
for a PPP interface. Compare with eg. a SLIP interface
>Fix:
Apply the following diffs:
diff -c src/sys/net/if_ppp.c.orig src/sys/net/if_ppp.c
*** src/sys/net/if_ppp.c.orig Sun Aug 13 00:13:51 1995
--- src/sys/net/if_ppp.c Thu Sep 21 19:30:52 1995
***************
*** 687,692 ****
--- 687,693 ----
IF_ENQUEUE(ifq, m0);
(*sc->sc_start)(sc);
}
+ sc->sc_if.if_lastchange = time;
splx(s);
return (0);
***************
*** 1095,1100 ****
--- 1096,1102 ----
u_int hlen;
sc->sc_if.if_ipackets++;
+ sc->sc_if.if_lastchange = time;
if (sc->sc_flags & SC_LOG_INPKT) {
printf("ppp%d: got %d bytes\n", sc->sc_if.if_unit, ilen);
diff -c src/sys/net/ppp_tty.c.orig src/sys/net/ppp_tty.c
*** src/sys/net/ppp_tty.c.orig Tue Jul 4 23:57:34 1995
--- src/sys/net/ppp_tty.c Thu Sep 21 19:27:58 1995
***************
*** 201,206 ****
--- 201,207 ----
sc->sc_outm = NULL;
pppgetm(sc);
sc->sc_if.if_flags |= IFF_RUNNING;
+ sc->sc_if.if_baudrate = tp->t_ospeed;
tp->t_sc = (caddr_t) sc;
ttyflush(tp, FREAD | FWRITE);
***************
*** 575,580 ****
--- 576,582 ----
/* Calculate the FCS for the first mbuf's worth. */
sc->sc_outfcs = pppfcs(PPP_INITFCS, mtod(m, u_char *), m->m_len);
+ sc->sc_if.if_lastchange = time;
}
for (;;) {
>Audit-Trail:
>Unformatted: