Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 May 2012 12:38:25 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        "Alexander V. Chernikov" <melifaro@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:  <4FBE6401.1010009@FreeBSD.org>
In-Reply-To: <4FBE1120.8020704@FreeBSD.org>
References:  <201205212219.q4LMJKR9076035@svn.freebsd.org> <4FBD7E65.1060205@FreeBSD.org> <4FBE1120.8020704@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----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-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FBE6401.1010009>