From: Daniel Lezcano Store private information for a socket This patch adds a field to the common socket structure. This field is a anonymous pointer which allow to store an information about the socket Signed-off-by: Daniel Lezcano --- include/net/inet_timewait_sock.h | 1 + include/net/sock.h | 3 +++ net/ipv4/inet_timewait_sock.c | 1 + 3 files changed, 5 insertions(+) Index: net-2.6.24-bf/include/net/sock.h =================================================================== --- net-2.6.24-bf.orig/include/net/sock.h +++ net-2.6.24-bf/include/net/sock.h @@ -106,6 +106,7 @@ * @skc_refcnt: reference count * @skc_hash: hash value used with various protocol lookup tables * @skc_prot: protocol handlers inside a network family + * @skc_private: field used to store private data * * This is the minimal network layer representation of sockets, the header * for struct sock and struct inet_timewait_sock. @@ -120,6 +121,7 @@ atomic_t skc_refcnt; unsigned int skc_hash; struct proto *skc_prot; + void *skc_private; }; /** @@ -196,6 +198,7 @@ #define sk_refcnt __sk_common.skc_refcnt #define sk_hash __sk_common.skc_hash #define sk_prot __sk_common.skc_prot +#define sk_private __sk_common.skc_private unsigned char sk_shutdown : 2, sk_no_check : 2, sk_userlocks : 4; Index: net-2.6.24-bf/net/ipv4/inet_timewait_sock.c =================================================================== --- net-2.6.24-bf.orig/net/ipv4/inet_timewait_sock.c +++ net-2.6.24-bf/net/ipv4/inet_timewait_sock.c @@ -108,6 +108,7 @@ tw->tw_hash = sk->sk_hash; tw->tw_ipv6only = 0; tw->tw_prot = sk->sk_prot_creator; + tw->tw_private = sk->sk_private; atomic_set(&tw->tw_refcnt, 1); inet_twsk_dead_node_init(tw); __module_get(tw->tw_prot->owner); Index: net-2.6.24-bf/include/net/inet_timewait_sock.h =================================================================== --- net-2.6.24-bf.orig/include/net/inet_timewait_sock.h +++ net-2.6.24-bf/include/net/inet_timewait_sock.h @@ -115,6 +115,7 @@ #define tw_refcnt __tw_common.skc_refcnt #define tw_hash __tw_common.skc_hash #define tw_prot __tw_common.skc_prot +#define tw_private __tw_common.skc_private volatile unsigned char tw_substate; /* 3 bits hole, try to pack */ unsigned char tw_rcv_wscale; -- - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html