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: <20140714.190839.1595507738609644305.davem@davemloft.net>
Date:	Mon, 14 Jul 2014 19:08:39 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	Jianhua.Xie@...escale.com
Cc:	netdev@...r.kernel.org, j.vosburgh@...il.com, vfalico@...il.com,
	andy@...yhouse.net, Jiafei.Pan@...escale.com
Subject: Re: [PATCH net] bonding: enhance L2 hash helper with packet type

From: Xie Jianhua <Jianhua.Xie@...escale.com>
Date: Mon, 14 Jul 2014 14:05:26 +0800

> @@ -3002,7 +3002,7 @@ static inline u32 bond_eth_hash(struct sk_buff *skb)
>  	struct ethhdr *data = (struct ethhdr *)skb->data;
>  
>  	if (skb_headlen(skb) >= offsetof(struct ethhdr, h_proto))
> -		return data->h_dest[5] ^ data->h_source[5];
> +		return data->h_dest[5] ^ data->h_source[5] ^ data->h_proto;
>  
>  	return 0;
>  }

About the headlen check, I don't like the idea that the hash depends upon
whether we have a fully fragmented packet or not.

Just use the appropriate interface, skb_header_pointer(), and recode this
as:

	struct ethhdr *ep, _hdr;

	ep = skb_header_pointer(skb, 0, sizeof(_hdr), &_hdr);
	if (ep)
		return ep->h_dest[5] ^ ep->h_source[5] ^ ep->h_proto;
	return 0;
--
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