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:	Wed, 15 Jun 2011 07:56:08 +0200
From:	Sven Eckelmann <sven@...fation.org>
To:	David Howells <dhowells@...hat.com>
Cc:	Marek Lindner <lindner_marek@...oo.de>,
	Simon Wunderlich <siwu@....tu-chemnitz.de>,
	b.a.t.m.a.n@...ts.open-mesh.org, netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] batman-adv: compare_eth() should take const pointer arguments

David Howells wrote:
> compare_eth() should take const pointer arguments so that it can be passed
> const pointers without the need for a cast, leading to:
> 
> net/batman-adv/vis.c: In function 'vis_data_insert_interface':
> net/batman-adv/vis.c:146: warning: passing argument 2 of 'compare_eth'
> discards qualifiers from pointer target type
> 
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Marek Lindner <lindner_marek@...oo.de>
> cc: Simon Wunderlich <siwu@....tu-chemnitz.de>
> cc: Sven Eckelmann <sven@...fation.org>
> cc: b.a.t.m.a.n@...ts.open-mesh.org
> cc: netdev@...r.kernel.org
> ---
> 
>  net/batman-adv/main.h |    2 +-
>  net/batman-adv/vis.c  |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
> index 148b49e..e6fc798 100644
> --- a/net/batman-adv/main.h
> +++ b/net/batman-adv/main.h
> @@ -172,7 +172,7 @@ static inline void bat_dbg(char type __always_unused,
>   *
>   * note: can't use compare_ether_addr() as it requires aligned memory
>   */
> -static inline int compare_eth(void *data1, void *data2)
> +static inline int compare_eth(const void *data1, const void *data2)
>  {
>  	return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
>  }
> diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
> index c39f20c..34053ac 100644
> --- a/net/batman-adv/vis.c
> +++ b/net/batman-adv/vis.c
> @@ -143,7 +143,7 @@ static void vis_data_insert_interface(const uint8_t
> *interface, struct hlist_node *pos;
> 
>  	hlist_for_each_entry(entry, pos, if_list, list) {
> -		if (compare_eth(entry->addr, (void *)interface))
> +		if (compare_eth(entry->addr, interface))
>  			return;
>  	}

Sry, but this patch doesn't apply here (net-next-2.6/linux-next)

Kind regards,
	Sven

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ