lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20150113.143633.1852338751965729543.davem@davemloft.net>
Date:	Tue, 13 Jan 2015 14:36:33 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	jiri@...nulli.us
Cc:	netdev@...r.kernel.org, jhs@...atatu.com, dborkman@...hat.com,
	ast@...mgrid.com, hannes@...hat.com
Subject: Re: [patch net-next v2] tc: add BPF based action

From: Jiri Pirko <jiri@...nulli.us>
Date: Mon, 12 Jan 2015 17:09:38 +0100

> +	bpf_len = nla_get_u16(tb[TCA_ACT_BPF_OPS_LEN]);
> +	if (bpf_len > BPF_MAXINSNS || bpf_len == 0)
> +		return -EINVAL;
> +
> +	bpf_size = bpf_len * sizeof(*bpf_ops);

When I see variables named 'len' and 'size', I expect them to be
in unit bytes.

I think it's clearer to call bpf_len something like "bpf_num_insns",
or "bpf_num_ops", or something like that.

Also, is the OPS_LEN attribute really necessary?  Can't you just
figure this out using nla_len() on the OPS attribute?  Or is that not
always accurate due to alignment?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ