[tproxy] [PATCH 03/11] TProxy: reuse a 32bit hole in struct ipv6_pinfo

Balazs Scheidler bazsi at balabit.hu
Sun Aug 23 11:02:11 CEST 2009


While looking for a place to add a new bitfield in ipv6_pinfo,
I've found a 32 bit hole (in 64 bit mode) at the beginning of the struct.
Since dst_cookie is used in the output fastpath, I've moved this field to
fill the hole, thus decreasing the struct size on 64 bit platforms by
4 bytes.

On 32 bit platforms the struct size doesn't change.

Signed-off-by: Balazs Scheidler <bazsi at balabit.hu>
---
 include/linux/ipv6.h |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c662efa..52dcbf7 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -285,6 +285,7 @@ struct ipv6_pinfo {
 	struct in6_addr 	saddr;
 	struct in6_addr 	rcv_saddr;
 	struct in6_addr		daddr;
+	__u32			dst_cookie;
 	struct in6_pktinfo	sticky_pktinfo;
 	struct in6_addr		*daddr_cache;
 #ifdef CONFIG_IPV6_SUBTREES
@@ -348,8 +349,6 @@ struct ipv6_pinfo {
 						 */
 	__u8			tclass;
 
-	__u32			dst_cookie;
-
 	struct ipv6_mc_socklist	*ipv6_mc_list;
 	struct ipv6_ac_socklist	*ipv6_ac_list;
 	struct ipv6_fl_socklist *ipv6_fl_list;
-- 
1.6.0.4




More information about the tproxy mailing list