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:	Thu, 27 Jun 2013 01:01:22 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Cong Wang <amwang@...hat.com>
Cc:	netdev@...r.kernel.org, Daniel Borkmann <dborkman@...hat.com>,
	"David S. Miller" <davem@...emloft.net>,
	Alexey Kuznetsov <kuznet@....inr.ac.ru>,
	James Morris <jmorris@...ei.org>,
	Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
	Patrick McHardy <kaber@...sh.net>, linux-kernel@...r.kernel.org
Subject: Re: [RFC Patch net-next 3/5] inetpeer: use generic union inet_addr

On Thu, 2013-06-27 at 14:43 +0800, Cong Wang wrote:
> Signed-off-by: Cong Wang <amwang@...hat.com>
> ---
>  include/net/inetpeer.h |   29 +++++----------
>  net/ipv4/inetpeer.c    |   35 +++++++++++-------
>  net/ipv4/tcp_metrics.c |   92 ++++++++++++++++++++----------------------------
>  3 files changed, 68 insertions(+), 88 deletions(-)
> 
> diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
> index 53f464d..7ec33fb 100644
> --- a/include/net/inetpeer.h
> +++ b/include/net/inetpeer.h
> @@ -13,24 +13,13 @@
>  #include <linux/spinlock.h>
>  #include <linux/rtnetlink.h>
>  #include <net/ipv6.h>
> +#include <net/inet_addr.h>
>  #include <linux/atomic.h>
>  
> -struct inetpeer_addr_base {
> -	union {
> -		__be32			a4;
> -		__be32			a6[4];
> -	};
> -};
> -
> -struct inetpeer_addr {
> -	struct inetpeer_addr_base	addr;
> -	__u16				family;
> -};
> -
>  struct inet_peer {
>  	/* group together avl_left,avl_right,v4daddr to speedup lookups */
>  	struct inet_peer __rcu	*avl_left, *avl_right;
> -	struct inetpeer_addr	daddr;
> +	union inet_addr		daddr;

Please compare sizeof(struct inetpeer_addr) and sizeof(union inet_addr)

If I am not mistaken, its 20 bytes instead of 28

Yes, sockaddr_in6 is a bit bloated...


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