From 47cb60fd855e46d5db07270ed611c5942ba5b7ed Mon Sep 17 00:00:00 2001 From: archie Date: Thu, 2 Dec 1999 19:36:05 +0000 Subject: [PATCH] Add 'const' to the bpf_filter() and bpf_validate() prototypes. Remove a stale comment from bpf_validate(). --- sys/net/bpf.h | 4 ++-- sys/net/bpf_filter.c | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/net/bpf.h b/sys/net/bpf.h index 64e16023542c..d3ab193146bf 100644 --- a/sys/net/bpf.h +++ b/sys/net/bpf.h @@ -226,12 +226,12 @@ struct bpf_insn { #define BPF_JUMP(code, k, jt, jf) { (u_short)(code), jt, jf, k } #ifdef KERNEL -int bpf_validate __P((struct bpf_insn *, int)); +int bpf_validate __P((const struct bpf_insn *, int)); void bpf_tap __P((struct ifnet *, u_char *, u_int)); void bpf_mtap __P((struct ifnet *, struct mbuf *)); void bpfattach __P((struct ifnet *, u_int, u_int)); void bpfilterattach __P((int)); -u_int bpf_filter __P((struct bpf_insn *, u_char *, u_int, u_int)); +u_int bpf_filter __P((const struct bpf_insn *, u_char *, u_int, u_int)); #endif /* diff --git a/sys/net/bpf_filter.c b/sys/net/bpf_filter.c index bff916348c53..0b2ed9e0d316 100644 --- a/sys/net/bpf_filter.c +++ b/sys/net/bpf_filter.c @@ -183,7 +183,7 @@ m_xhalf(m, k, err) */ u_int bpf_filter(pc, p, wirelen, buflen) - register struct bpf_insn *pc; + register const struct bpf_insn *pc; register u_char *p; u_int wirelen; register u_int buflen; @@ -512,19 +512,17 @@ bpf_filter(pc, p, wirelen, buflen) * Return true if the 'fcode' is a valid filter program. * The constraints are that each jump be forward and to a valid * code. The code must terminate with either an accept or reject. - * 'valid' is an array for use by the routine (it must be at least - * 'len' bytes long). * * The kernel needs to be able to verify an application's filter code. * Otherwise, a bogus program could easily crash the system. */ int bpf_validate(f, len) - struct bpf_insn *f; + const struct bpf_insn *f; int len; { register int i; - register struct bpf_insn *p; + register const struct bpf_insn *p; for (i = 0; i < len; ++i) { /*