From owner-freebsd-net Tue Nov 27 11:47:45 2001 Delivered-To: freebsd-net@freebsd.org Received: from mailman.packetdesign.com (dns.packetdesign.com [65.192.41.10]) by hub.freebsd.org (Postfix) with ESMTP id 1375737B41A for ; Tue, 27 Nov 2001 11:47:37 -0800 (PST) Received: from nimitz.packetdesign.com (nimitz.packetdesign.com [192.168.0.184]) by mailman.packetdesign.com (8.11.0/8.11.0) with ESMTP id fARJla531318; Tue, 27 Nov 2001 11:47:36 -0800 (PST) (envelope-from bmah@packetdesign.com) Received: (from bmah@localhost) by nimitz.packetdesign.com (8.11.6/8.11.6) id fARJlaq00597; Tue, 27 Nov 2001 11:47:36 -0800 (PST) (envelope-from bmah) Message-Id: <200111271947.fARJlaq00597@nimitz.packetdesign.com> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: freebsd-net@freebsd.org Cc: bmah@packetdesign.com Subject: RFC: MFC M_ZERO usage for bpf.c From: bmah@packetdesign.com (Bruce A. Mah) Reply-To: bmah@packetdesign.com X-Face: g~c`.{#4q0"(V*b#g[i~rXgm*w;:nMfz%_RZLma)UgGN&=j`5vXoU^@n5v4:OO)c["!w)nD/!!~e4Sj7LiT'6*wZ83454H""lb{CC%T37O!!'S$S&D}sem7I[A 2V%N&+ X-Image-Url: http://www.employees.org/~bmah/Images/bmah-cisco-small.gif X-Url: http://www.employees.org/~bmah/ Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1865514496P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Tue, 27 Nov 2001 11:47:36 -0800 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --==_Exmh_1865514496P Content-Type: text/plain; charset=us-ascii Hi-- I've been reading through src/sys/net/bpf.c, and I noticed that the changes to make it use M_ZERO haven't been MFC-ed to RELENG_4 yet. Any objection if I do this? (Nothing broke in my quick testing.) Thanks, Bruce. Index: bpf.c =================================================================== RCS file: /usr/ncvs/src/sys/net/bpf.c,v retrieving revision 1.59.2.6 diff -u -r1.59.2.6 bpf.c --- bpf.c 20 Sep 2001 14:31:33 -0000 1.59.2.6 +++ bpf.c 27 Nov 2001 18:49:45 -0000 @@ -358,8 +358,7 @@ if (d) return (EBUSY); make_dev(&bpf_cdevsw, minor(dev), 0, 0, 0600, "bpf%d", lminor(dev)); - MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_WAITOK); - bzero(d, sizeof(*d)); + MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_WAITOK | M_ZERO); dev->si_drv1 = d; d->bd_bufsize = bpf_bufsize; d->bd_sig = SIGIO; @@ -1285,11 +1284,10 @@ u_int dlt, hdrlen; { struct bpf_if *bp; - bp = (struct bpf_if *)malloc(sizeof(*bp), M_BPF, M_DONTWAIT); + bp = (struct bpf_if *)malloc(sizeof(*bp), M_BPF, M_DONTWAIT | M_ZERO); if (bp == 0) panic("bpfattach"); - bp->bif_dlist = 0; bp->bif_ifp = ifp; bp->bif_dlt = dlt; --==_Exmh_1865514496P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: Exmh on FreeBSD iD8DBQE8A+3Y2MoxcVugUsMRAl5/AJwOOfK4eWs8cBXCCssGhHoL0EXiKACgsgKO GAWQ29KVho5yzajShM5Jrio= =OroY -----END PGP SIGNATURE----- --==_Exmh_1865514496P-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message