svn commit: r235746 - head/sys/net
Jung-uk Kim
jkim at FreeBSD.org
Thu May 24 16:38:26 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 2012-05-24 06:44:48 -0400, Alexander V. Chernikov wrote:
> Does the attached patch look ok to you?
Generally looks good. Few nits:
- --- bpf.c ---
1713: #ifdef BPF_JITTER
1714: bpf_jit_filter *ofunc, *jfunc;
1715: #endif
Please add jfunc before ofunc, i.e., style(9).
1743: if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) != 0 ||
1744: (bpf_validate(fcode, (int)flen) == 0)) {
1745: free(fcode, M_BPF);
1746: return (EINVAL);
1747: }
Excessive parens @ L1744.
1752: #ifdef BPF_JITTER
1753: if (fp->bf_insns != NULL)
1754: jfunc = bpf_jitter(fcode, flen);
1755: else
1756: jfunc = NULL; /* Make compiler happy */
1757: #endif
Please test 'fcode' instead of 'fp->bf_insns' for consistency.
- --- bpf_jitter.c ---
72: #ifdef _KERNEL
73: filter = (struct bpf_jit_filter *)malloc(sizeof(*filter),
74: M_BPFJIT, M_WAITOK);
75: #else
This change is bogus because bpf_jit_compile() does more malloc(9)
calls with M_NOWAIT, bpf_jitter() failures are not fatal (i.e., all
consumers fall back to bpf_filter(9)), all consumers (e.g., ng_bpf.c)
assume M_NOWAIT, etc, etc...
Please note I haven't looked at other locking changes.
Thanks,
Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk++ZAAACgkQmlay1b9qnVObOgCfZmKOtPC8BhsnUK4I9LC5fW53
ePwAnipYRZFYNSi/5KFs2J3+L62zUMId
=CASZ
-----END PGP SIGNATURE-----
More information about the svn-src-all
mailing list