kern/115931: [patch] change bpf_filter() mem[] from int32_t to
u_int32_t
Matthew Luckie
mjl at luckie.org.nz
Wed Aug 29 15:40:01 PDT 2007
>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: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Aug 29 22:40:00 GMT 2007
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:
More information about the freebsd-bugs
mailing list