From mjl@luckie.org.nz  Wed Aug 29 22:37:22 2007
Return-Path: <mjl@luckie.org.nz>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DDD9216A420
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 29 Aug 2007 22:37:22 +0000 (UTC)
	(envelope-from mjl@luckie.org.nz)
Received: from smtpqueue7.ihug.co.nz (smtpqueue7.ihug.co.nz [203.109.136.157])
	by mx1.freebsd.org (Postfix) with ESMTP id 9E9E113C467
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 29 Aug 2007 22:37:22 +0000 (UTC)
	(envelope-from mjl@luckie.org.nz)
Received: from smtp14.content.ihug.net.nz (smtp14.ihug.co.nz) [10.80.52.14] 
	by smtpqueue7.ihug.co.nz with esmtp
	(Exim 4.60 #1 (Debian); Ihug conf #192)
	id 1IQVqY-0004eN-Gi; Thu, 30 Aug 2007 10:17:10 +1200
Received: from cust.filter1.content.ihug.net.nz (smtp.mailfilter1.ihug.co.nz) [10.80.50.1] 
	by smtp14.ihug.co.nz with esmtp
	(Exim 4.60 #1 (Debian); Ihug conf #192)
	id 1IQVqU-0007o9-T1; Thu, 30 Aug 2007 10:17:06 +1200
Received: from 203-173-181-4.dsl.dyn.ihug.co.nz (HELO latex.plunket.luckie.org.nz) ([203.173.181.4])
  by smtp.mailfilter1.ihug.co.nz with ESMTP/TLS/DHE-RSA-AES256-SHA; 30 Aug 2007 10:17:06 +1200
Received: from mjl by latex.plunket.luckie.org.nz with local (Exim 4.67 (FreeBSD))
	(envelope-from <mjl@luckie.org.nz>)
	id 1IQVqS-000HyL-Rx
	for FreeBSD-gnats-submit@freebsd.org; Thu, 30 Aug 2007 10:17:04 +1200
Message-Id: <E1IQVqS-000HyL-Rx@latex.plunket.luckie.org.nz>
Date: Thu, 30 Aug 2007 10:17:04 +1200
From: Matthew Luckie <mjl@luckie.org.nz>
Sender: Matthew Luckie <mjl@luckie.org.nz>
Reply-To: Matthew Luckie <mjl@luckie.org.nz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] change bpf_filter() mem[] from int32_t to u_int32_t
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         115931
>Category:       kern
>Synopsis:       [patch] change bpf_filter() mem[] from int32_t to u_int32_t
>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:   Wed Aug 29 22:40:00 GMT 2007
>Closed-Date:    Fri Nov 02 16:28:05 UTC 2007
>Last-Modified:  Tue Jul 10 03:39:41 UTC 2012
>Originator:     Matthew Luckie
>Release:        FreeBSD 6.1-RELEASE alpha
>Organization:
University of Waikato
>Environment:
System: FreeBSD latex.plunket.luckie.org.nz 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sat Jul 15 11:56:01 NZST 2006 root@:/usr/src/sys/alpha/compile/latex alpha


	
>Description:
In bpf_filter.c : bpf_filter() A and X are declared u_int32_t.  mem[] is
declared as int32_t.  The only things that get saved or restored from mem[]
are A and X.  I suggest that mem[] be changed to u_int32_t to be precise
about what is stored in there.  I'm well aware how pedantic this is.

I have compared the output for objdump -S on bpf_filter.o compiled with
and without this patch on i386 and alpha on FreeBSD releases 6.2 and 6.1
respectively and there is zero change in the actual machine code generated. 

>How-To-Repeat:
	
>Fix:

	

--- bpf_filter.c.patch begins here ---
--- bpf_filter.c.orig	Thu Aug 30 09:48:40 2007
+++ bpf_filter.c	Thu Aug 30 10:08:23 2007
@@ -186,7 +186,7 @@
 {
 	register u_int32_t A = 0, X = 0;
 	register bpf_u_int32 k;
-	int32_t mem[BPF_MEMWORDS];
+	u_int32_t mem[BPF_MEMWORDS];
 
 	if (pc == 0)
 		/*
--- bpf_filter.c.patch ends here ---

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->csjp 
Responsible-Changed-By: remko 
Responsible-Changed-When: Thu Aug 30 05:55:31 UTC 2007 
Responsible-Changed-Why:  
Hey Christian, I thought you touched this recently, would this be 
something for you? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115931 
Responsible-Changed-From-To: csjp->dwmalone 
Responsible-Changed-By: dwmalone 
Responsible-Changed-When: Thu Aug 30 08:32:16 UTC 2007 
Responsible-Changed-Why:  
I'll grab this, unless Christian really wants to look at it. I've 
already had a look at the problem for Matthew. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115931 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/115931: commit references a PR
Date: Thu, 13 Sep 2007 09:00:38 +0000 (UTC)

 dwmalone    2007-09-13 09:00:32 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/net              bpf_filter.c 
   Log:
   Make the type of the memory used by the BPF filter unsigned, so it
   matches the BPF registers (which are the only thing that is assigned
   to/from BPF memory). This is a pedantic change that shouldn't change
   any behaviour.
   
   PR:             115931
   Submitted by:   Matthew Luckie <mjl@luckie.org.nz>
   Approved by:    re (bmah)
   MFC after:      3 weeks
   
   Revision  Changes    Path
   1.28      +1 -1      src/sys/net/bpf_filter.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->closed 
State-Changed-By: dwmalone 
State-Changed-When: Fri Nov 2 16:27:33 UTC 2007 
State-Changed-Why:  
Now patched in HEAD, RELENG_7 and RELENG_6. Thanks for the patch. 

David. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115931 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/115931: commit references a PR
Date: Fri,  2 Nov 2007 18:54:15 +0000 (UTC)

 dwmalone    2007-11-02 16:27:22 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/net              bpf_filter.c 
   Log:
   MFC 1.28:
   Make the type of the memory used by the BPF filter unsigned, so it
   matches the BPF registers (which are the only thing that is assigned
   to/from BPF memory). This is a pedantic change that shouldn't change
   any behaviour.
   
   PR:             115931
   Submitted by:   Matthew Luckie <mjl@luckie.org.nz>
   
   Revision  Changes    Path
   1.23.2.2  +1 -1      src/sys/net/bpf_filter.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
Responsible-Changed-From-To: dwmalone->freebsd-bugs 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue Jul 10 03:39:40 UTC 2012 
Responsible-Changed-Why:  
over to the pool (approved by bugmeister) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=115931 
>Unformatted:
