Add 'const' to the bpf_filter() and bpf_validate() prototypes.

Remove a stale comment from bpf_validate().
This commit is contained in:
archie 1999-12-02 19:36:05 +00:00
parent c97e39268b
commit 47cb60fd85
2 changed files with 5 additions and 7 deletions

View File

@ -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
/*

View File

@ -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) {
/*