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] [day] [month] [year] [list]
Date:	Tue, 26 Nov 2013 10:01:54 -0000
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"Tom Herbert" <therbert@...gle.com>, <davem@...emloft.net>,
	<netdev@...r.kernel.org>
Subject: RE: [PATCH 01/17] net: Add utility function to clear rxhash

> From: Tom Herbert
> 
> In several places 'skb->rxhash = 0' is being done to clear the
> rxhash value in an skb.  This does not clear l4_rxhash which could
> still be set so that the rxhash wouldn't be recalculated on subsequent
> call to skb_get_rxhash.  This patch adds an explict function to clear
> all the rxhash related information in the skb properly.
> 
...
> 
> +static inline void skb_clear_rxhash(struct sk_buff *skb)
> +{
> +	skb->rxhash = 0;
> +	skb->l4_rxhash = 0;
> +}

Wouldn't it be better to also change the names of the structure members.
Then you'd be sure to find all the uses.

And in patch 2/17 ...

+enum rxhash_types {

Add RXHASH_TYPE_UNSET

+	RXHASH_TYPE_NONE,	/* Undefined type */
+	RXHASH_TYPE_L2,		/* Uses L2 information (addresses) */
+	RXHASH_TYPE_L3,		/* Uses L3 information */
+	RXHASH_TYPE_L4,		/* Uses L4 information (ports) */
+};
+
+static inline void
+skb_set_rxhash(struct sk_buff *skb, __u32 hash, enum rxhash_types type)
+{
+	skb->l4_rxhash = (type == RXHASH_TYPE_L4);

Save the actual type.

+	skb->rxhash = hash;
+}

	David




--
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