ipv6: move INET6_MATCH() to include/net/inet6_hashtables.h
authorWANG Cong <xiyou.wangcong@gmail.com>
Tue, 4 Nov 2014 18:59:47 +0000 (10:59 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Nov 2014 21:59:04 +0000 (16:59 -0500)
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>
include/linux/ipv6.h
include/net/inet6_hashtables.h

index 7121a2e..c694e7b 100644 (file)
@@ -317,14 +317,4 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
 #define tcp_twsk_ipv6only(__sk)                0
 #define inet_v6_ipv6only(__sk)         0
 #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 /* _IPV6_H */
index d1d2728..9201afe 100644 (file)
@@ -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 */