diff options
author | Pavel Emelyanov | 2008-01-31 14:03:27 +0100 |
---|---|---|
committer | David S. Miller | 2008-02-01 04:28:17 +0100 |
commit | 535174efbe0f0454f0595c31b823498c197eeb4f (patch) | |
tree | 7fc438f82e73f117882e31b6f7025e295e399b09 /include/linux/ipv6.h | |
parent | [NETFILTER]: xt_iprange: fix sparse warnings (diff) | |
download | kernel-qcow2-linux-535174efbe0f0454f0595c31b823498c197eeb4f.tar.gz kernel-qcow2-linux-535174efbe0f0454f0595c31b823498c197eeb4f.tar.xz kernel-qcow2-linux-535174efbe0f0454f0595c31b823498c197eeb4f.zip |
[IPV6]: Introduce the INET6_TW_MATCH macro.
We have INET_MATCH, INET_TW_MATCH and INET6_MATCH to test sockets and
twbuckets for matching, but ipv6 twbuckets are tested manually.
Here's the INET6_TW_MATCH to help with it.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/ipv6.h')
-rw-r--r-- | include/linux/ipv6.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 5d35a4cc3bff..c34786044a1b 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h @@ -465,6 +465,14 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) +#define INET6_TW_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif) \ + (((__sk)->sk_hash == (__hash)) && \ + (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ + ((__sk)->sk_family == PF_INET6) && \ + (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ + (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \ + (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) + #endif /* __KERNEL__ */ #endif /* _IPV6_H */ |