+ case PPPIO_PASSFILT:
+ case PPPIO_ACTIVEFILT:
+ if ((us->flags & US_CONTROL) == 0)
+ break;
+ len = iop->ioc_count;
+ if (len > BPF_MAXINSNS * sizeof(struct bpf_insn)
+ || len % sizeof(struct bpf_insn) != 0)
+ break;
+ if (len > 0) {
+ if (!bpf_validate((struct bpf_insn *) mp->b_cont->b_rptr,
+ len / sizeof(struct bpf_insn)))
+ break;
+ ip = (struct bpf_insn *) ALLOC_NOSLEEP(len);
+ if (ip == 0) {
+ error = ENOSR;
+ break;
+ }
+ bcopy((caddr_t)mp->b_cont->b_rptr, (caddr_t)ip, len);
+ } else
+ ip = 0;
+ dest = iop->ioc_cmd == PPPIO_ACTIVEFILT?
+ &us->active_f: &us->pass_f;
+ if (dest->bf_insns != 0)
+ kmem_free((caddr_t) dest->bf_insns, dest->bf_len);
+ dest->bf_len = len;
+ dest->bf_insns = ip;
+ break;
+