From owner-freebsd-bugs Sun Jan 25 11:40:03 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA09036 for freebsd-bugs-outgoing; Sun, 25 Jan 1998 11:40:03 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: (from gnats@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA09010; Sun, 25 Jan 1998 11:40:01 -0800 (PST) (envelope-from gnats) Date: Sun, 25 Jan 1998 11:40:01 -0800 (PST) Message-Id: <199801251940.LAA09010@hub.freebsd.org> To: freebsd-bugs Cc: From: Steve Price Subject: Re: misc/1376 Reply-To: Steve Price Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR misc/1376; it has been noted by GNATS. From: Steve Price To: Bill Fenner Cc: risner@stdio.com, freebsd-gnats-submit@hub.freebsd.org Subject: Re: misc/1376 Date: Sun, 25 Jan 1998 13:40:09 -0600 Bill Fenner wrote: > > I don't think this is appropriate; as Gary said, the correct thing is > probably to bzero the if_data struct (e.g. why should ibytes get set to > zero but not imcasts, or iqdrops?). This is why I just applied it to -current. :) Would the attached patch make everyone happier? If not, your patches are always welcome. Steve > Bill Index: if_tun.c =================================================================== RCS file: /u/FreeBSD/cvs/src/sys/net/if_tun.c,v retrieving revision 1.41 diff -u -Lif_tun.c -r1.41 if_tun.c --- if_tun.c +++ if_tun.c 1998/01/25 19:22:27 @@ -125,16 +125,12 @@ ifp = &tunctl[i].tun_if; + memset(&ifp->if_data, 0, sizeof(ifp->if_data)); ifp->if_unit = i; ifp->if_name = "tun"; ifp->if_mtu = TUNMTU; ifp->if_ioctl = tunifioctl; ifp->if_output = tunoutput; ifp->if_flags = IFF_POINTOPOINT | IFF_MULTICAST; ifp->if_snd.ifq_maxlen = ifqmaxlen; - ifp->if_collisions = 0; - ifp->if_ierrors = 0; - ifp->if_oerrors = 0; - ifp->if_ipackets = 0; - ifp->if_opackets = 0; if_attach(ifp); #if NBPFILTER > 0 bpfattach(ifp, DLT_NULL, sizeof(u_int));