summaryrefslogtreecommitdiffstats
path: root/sys/net/bpf_filter.c
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2005-12-08 08:49:30 +0000
committerotto <otto@openbsd.org>2005-12-08 08:49:30 +0000
commita555f402688b9d8699d6e497c528c7dbb0d9b9cd (patch)
treeece77bdeb4be60cbc484e1996fd534578ac1371d /sys/net/bpf_filter.c
parentDo not reset the IPL of the new process context frame in cpu_fork(). (diff)
downloadwireguard-openbsd-a555f402688b9d8699d6e497c528c7dbb0d9b9cd.tar.xz
wireguard-openbsd-a555f402688b9d8699d6e497c528c7dbb0d9b9cd.zip
Avoid sign extend by casting to u_char *; from NetBSD via Guy Harris.
Also change another cast, for the sake of consistency, as prompted by djm@ ok deraadt@ djm@ canacar@
Diffstat (limited to 'sys/net/bpf_filter.c')
-rw-r--r--sys/net/bpf_filter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c
index e33b66dbae9..1a00b79fc61 100644
--- a/sys/net/bpf_filter.c
+++ b/sys/net/bpf_filter.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf_filter.c,v 1.15 2005/09/28 20:53:56 miod Exp $ */
+/* $OpenBSD: bpf_filter.c,v 1.16 2005/12/08 08:49:30 otto Exp $ */
/* $NetBSD: bpf_filter.c,v 1.12 1996/02/13 22:00:00 christos Exp $ */
/*
@@ -301,7 +301,7 @@ bpf_filter(pc, p, wirelen, buflen)
return 0;
m = (struct mbuf *)p;
MINDEX(len, m, k);
- A = mtod(m, char *)[k];
+ A = mtod(m, u_char *)[k];
continue;
#else
return 0;
@@ -321,7 +321,7 @@ bpf_filter(pc, p, wirelen, buflen)
return 0;
m = (struct mbuf *)p;
MINDEX(len, m, k);
- X = (mtod(m, char *)[k] & 0xf) << 2;
+ X = (mtod(m, u_char *)[k] & 0xf) << 2;
continue;
#else
return 0;