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: <20180403071431.3r5kdqjnhjrdn6px@mwanda>
Date:   Tue, 3 Apr 2018 10:14:31 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Quytelda Kahja <quytelda@...alin.org>
Cc:     gregkh@...uxfoundation.org, wsa@...-dreams.de,
        devel@...verdev.osuosl.org, driverdev-devel@...uxdriverproject.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 74/75] staging: ks7010: Replace memcmp() with
 ether_addr_equal().

On Fri, Mar 30, 2018 at 11:08:54PM -0700, Quytelda Kahja wrote:
> ether_addr_equal() is the function for comparing HW addresses,
> so remove the manual memcmp operation and replace it with
> ether_addr_equals().
> 
> Signed-off-by: Quytelda Kahja <quytelda@...alin.org>
> ---
>  drivers/staging/ks7010/ks_hostif.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index d816a06939aa..b5a2ba702dec 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -411,7 +411,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
>  	eth_proto = ntohs(eth_hdr->h_proto);
>  
>  	/* source address check */
> -	if (memcmp(dev->dev_addr, eth_hdr->h_source, ETH_ALEN) == 0) {
> +	if (ether_addr_equal(dev->dev_addr, eth_hdr->h_source)) {
>  		netdev_err(dev, "invalid : source is own mac address !!\n");
>  		netdev_err(dev,
>  			   "eth_hdrernet->h_dest=%02X:%02X:%02X:%02X:%02X:%02X\n",
> @@ -1103,7 +1103,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
>  
>  	/* skb check */
>  	eth = (struct ethhdr *)skb->data;
> -	if (memcmp(priv->net_dev->dev_addr, eth->h_source, ETH_ALEN) != 0) {
> +	if (ether_addr_equal(priv->net_dev->dev_addr, eth->h_source)) {

This test is reversed.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ