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]
Date:	Sun, 19 Jan 2014 18:35:49 +0000
From:	Ben Hutchings <ben@...adent.org.uk>
To:	Venkata Duvvuru <VenkatKumar.Duvvuru@...lex.Com>
Cc:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/4 ethtool] ethtool: Support for configurable RSS hash
 key.

On Fri, 2014-01-17 at 13:02 +0000, Venkata Duvvuru wrote:
> This ethtool patch will primarily implement the parser for the options provided by the user for set and get hashkey before invoking the ioctl.
> This patch also has Ethtool man page changes which describes the Usage of set and get hashkey options.

I'd prefer to have this combined with the -x/-X options (and add new
long options to reflect that they cover the key as well).

[...]
> diff --git a/ethtool.c b/ethtool.c
> index b06dfa3..4b05b0c 100644
> --- a/ethtool.c
> +++ b/ethtool.c
> @@ -471,6 +471,59 @@ static int rxflow_str_to_type(const char *str)
>  	return flow_type;
>  }
>  
> +static inline int is_hkey_char_valid(const char rss_hkey_string) {

A char is not a string.

> +	/* Are there any invalid characters in the string */
> +	return ((rss_hkey_string >= '0' && rss_hkey_string <= '9') ||
> +	       (rss_hkey_string >= 'a' && rss_hkey_string <= 'f') ||
> +	       (rss_hkey_string >= 'A' && rss_hkey_string <= 'F')); }

Braces are in the wrong places.  And the whole function is redundant
with isxdigit() anyway.

> +static int convert_string_to_hashkey(struct ethtool_rss_hkey *rss_hkey,
> +				      const char *rss_hkey_string)
> +{
> +	int i = 0;
> +	int hex_byte;
> +
> +	do {
> +		if (i > (RSS_HASH_KEY_LEN - 1)) {

Comparing with the wrong limit.

[...]
> +static int get_hashkey(struct cmd_context *ctx) {

Brace in the wrong place.

[...]
> +	for (i = 0; i < RSS_HASH_KEY_LEN; i++) {
> +		if (i == (RSS_HASH_KEY_LEN - 1))

Wrong length.

> +			printf("%02x\n", rss_hkey->data[i]);
> +		else
> +			printf("%02x:", rss_hkey->data[i]);
> +	}
> +
> +done:
> +	free(rss_hkey);
> +	return rc;
> +}
[...]

-- 
Ben Hutchings
friends: People who know you well, but like you anyway.

Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ