diff options
author | archie <archie@FreeBSD.org> | 1999-12-02 19:36:05 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 1999-12-02 19:36:05 +0000 |
commit | 47cb60fd855e46d5db07270ed611c5942ba5b7ed (patch) | |
tree | 018a62c7b94ea2e5ca0bbdd522982d2977803a04 /sys/net | |
parent | c97e39268be89e61a5f91f95ef70320e641e1d52 (diff) | |
download | FreeBSD-src-47cb60fd855e46d5db07270ed611c5942ba5b7ed.zip FreeBSD-src-47cb60fd855e46d5db07270ed611c5942ba5b7ed.tar.gz |
Add 'const' to the bpf_filter() and bpf_validate() prototypes.
Remove a stale comment from bpf_validate().
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bpf.h | 4 | ||||
-rw-r--r-- | 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 64e1602..d3ab193 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 bff9163..0b2ed9e 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) { /* |