diff options
author | WANG Cong <xiyou.wangcong@gmail.com> | 2014-11-04 10:59:47 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-05 16:59:04 -0500 |
commit | 25de4668d094f00e44a8f2428dd3c1a4ecfa0053 (patch) | |
tree | feb481e52578e7278538814191777d500cb2ccc1 /include/net/inet6_hashtables.h | |
parent | 51f3d02b980a338cd291d2bc7629cdfb2568424b (diff) | |
download | op-kernel-dev-25de4668d094f00e44a8f2428dd3c1a4ecfa0053.zip op-kernel-dev-25de4668d094f00e44a8f2428dd3c1a4ecfa0053.tar.gz |
ipv6: move INET6_MATCH() to include/net/inet6_hashtables.h
It is only used in net/ipv6/inet6_hashtables.c.
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/inet6_hashtables.h')
-rw-r--r-- | include/net/inet6_hashtables.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index d1d2728..9201afe0 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h @@ -99,4 +99,14 @@ struct sock *inet6_lookup(struct net *net, struct inet_hashinfo *hashinfo, const struct in6_addr *daddr, const __be16 dport, const int dif); #endif /* IS_ENABLED(CONFIG_IPV6) */ + +#define INET6_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \ + (((__sk)->sk_portpair == (__ports)) && \ + ((__sk)->sk_family == AF_INET6) && \ + ipv6_addr_equal(&(__sk)->sk_v6_daddr, (__saddr)) && \ + ipv6_addr_equal(&(__sk)->sk_v6_rcv_saddr, (__daddr)) && \ + (!(__sk)->sk_bound_dev_if || \ + ((__sk)->sk_bound_dev_if == (__dif))) && \ + net_eq(sock_net(__sk), (__net))) + #endif /* _INET6_HASHTABLES_H */ |