Date: Thu, 24 May 2012 14:44:48 +0400 From: "Alexander V. Chernikov" <melifaro@FreeBSD.org> To: Jung-uk Kim <jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r235746 - head/sys/net Message-ID: <4FBE1120.8020704@FreeBSD.org> In-Reply-To: <4FBD7E65.1060205@FreeBSD.org> References: <201205212219.q4LMJKR9076035@svn.freebsd.org> <4FBD7E65.1060205@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------010906000107090302010705 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 24.05.2012 04:18, Jung-uk Kim wrote: ... >> @@ -1664,7 +1668,7 @@ bpf_setf(struct bpf_d *d, struct bpf_pro >> struct bpf_insn *fcode, *old; u_int wfilter, flen, size; #ifdef >> BPF_JITTER - bpf_jit_filter *ofunc; + bpf_jit_filter *ofunc, >> *jfunc; #endif int need_upgrade; #ifdef COMPAT_FREEBSD32 @@ -1695,6 >> +1699,13 @@ bpf_setf(struct bpf_d *d, struct bpf_pro else fcode = >> NULL; /* Make compiler happy */ >> >> +#ifdef BPF_JITTER + if (fp->bf_insns != NULL) + jfunc = >> bpf_jitter(fcode, flen); + else + jfunc = NULL; /* Make compiler >> happy */ +#endif + BPF_LOCK(); >> >> if (cmd == BIOCSETWF) { > ... > > This is completely wrong. First, fcode has not been initialized with Ups. Does the attached patch look ok to you? --------------010906000107090302010705 Content-Type: text/plain; name="bpf_jitter.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bpf_jitter.diff" SW5kZXg6IHN5cy9uZXQvYnBmLmMKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL25ldC9icGYuYwko cmV2aXNpb24gMjM1NzUwKQorKysgc3lzL25ldC9icGYuYwkod29ya2luZyBjb3B5KQpAQCAt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wZl9qaXRfZmlsdGVyICopbWFsbG9jKHNp emVvZigqZmlsdGVyKSwKLQkgICAgTV9CUEZKSVQsIE1fTk9XQUlUKTsKKwkgICAgTV9CUEZK SVQsIE1fV0FJVE9LKTsKICNlbHNlCiAJZmlsdGVyID0gKHN0cnVjdCBicGZfaml0X2ZpbHRl ciAqKW1hbGxvYyhzaXplb2YoKmZpbHRlcikpOwogI2VuZGlmCg== --------------010906000107090302010705--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FBE1120.8020704>