diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-12-08 08:49:31 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2005-12-08 08:49:31 +0000 |
commit | 1e6de3f4f18390ef34fecf4a5d1ca38677fc0ce4 (patch) | |
tree | e799009bb35ee37571990758a5f63bb765aa263b | |
parent | fb96c9cf13fe30a649786398ca966e6a6a01afd0 (diff) |
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@
-rw-r--r-- | sys/net/bpf_filter.c | 6 |
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; |