OpenVZ Forum - RDF feed
type: channel
items: [PATCH 6/12] L2 network namespace: socket hashes

[PATCH 6/12] L2 network namespace: socket hashes
type: item
description: Socket hash lookups are made within namespace. Hash tables are common for all namespaces, with additional permutation of indexes. Asynchronous events should be run in proper namespace. Signed-off-by: Dmitry Mishin <dim@openvz.org> --- include/linux/ipv6.h | 3 ++- include/net/inet6_hashtables.h | 6 ++++-- include/net/inet_hashtables.h | 38 +++++++++++++++++++++++++------------- include/net/inet_sock.h | 6 ++++-- include/net/inet_timewait_sock.h | 2 ++ include/net/sock.h | 4 ++++ include/net/udp.h | 4 ++++ net/core/sock.c | 6 ++++++ net/ipv4/af_inet.c | 11 +++++++++++ net/ipv4/inet_connection_sock.c | 19 +++++++++++++++---- net/ipv4/inet_hashtables.c | 30 +++++++++++++++++++++++------- net/ipv4/inet_timewait_sock.c | 17 +++++++++++++++-- net/ipv4/raw.c | 2 ++ net/ipv4/tcp_timer.c | 9 +++++++++ net/ipv4/udp.c | 27 ++++++++++++++++++--------- net/ipv6/inet6_connection_sock.c | 2 ++ net/ipv6/inet6_hashtables.c | 25 ++++++++++++++++++------- net/ipv6/raw.c | 4 ++++ net/ipv6/udp.c | 10 ++++++++-- 19 files changed, 176 insertions(+), 49 deletions(-) --- linux-2.6.19-rc6-mm2.orig/include/linux/ipv6.h +++ linux-2.6.19-rc6-mm2/include/linux/ipv6.h @@ -459,10 +459,11 @@ static inline struct raw6_sock *raw6_sk( #define inet_v6_ipv6only(__sk) 0 #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ -#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ +#define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif, __ns)\ (((__sk)->sk_hash == (__hash)) && \ ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ ((__sk)->sk_family == AF_INET6) && \ + net_ns_match((__sk)->sk_net_ns, __ns) && \ ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) --- linux-2.6.19-rc6-mm2.orig/include/net/inet6_hashtables.h +++ linux-2.6.19-rc6-mm2/include/net/inet6_hashtables.h @@ -26,11 +26,13 @@ struct inet_hashinfo; /* I have no…
creator: Mishin Dmitry
date: 2006-12-06T22:27:25-00:00