Commit eda090c3 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

inet: rename INET_MATCH()

This is no longer a macro, but an inlined function.

INET_MATCH() -> inet_match()
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Suggested-by: default avatarOlivier Hartkopp <socketcan@hartkopp.net>
Suggested-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5d368f03
...@@ -267,7 +267,7 @@ static inline struct sock *inet_lookup_listener(struct net *net, ...@@ -267,7 +267,7 @@ static inline struct sock *inet_lookup_listener(struct net *net,
((__force __u64)(__be32)(__saddr))) ((__force __u64)(__be32)(__saddr)))
#endif /* __BIG_ENDIAN */ #endif /* __BIG_ENDIAN */
static inline bool INET_MATCH(struct net *net, const struct sock *sk, static inline bool inet_match(struct net *net, const struct sock *sk,
const __addrpair cookie, const __portpair ports, const __addrpair cookie, const __portpair ports,
int dif, int sdif) int dif, int sdif)
{ {
......
...@@ -373,10 +373,10 @@ struct sock *__inet_lookup_established(struct net *net, ...@@ -373,10 +373,10 @@ struct sock *__inet_lookup_established(struct net *net,
sk_nulls_for_each_rcu(sk, node, &head->chain) { sk_nulls_for_each_rcu(sk, node, &head->chain) {
if (sk->sk_hash != hash) if (sk->sk_hash != hash)
continue; continue;
if (likely(INET_MATCH(net, sk, acookie, ports, dif, sdif))) { if (likely(inet_match(net, sk, acookie, ports, dif, sdif))) {
if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt))) if (unlikely(!refcount_inc_not_zero(&sk->sk_refcnt)))
goto out; goto out;
if (unlikely(!INET_MATCH(net, sk, acookie, if (unlikely(!inet_match(net, sk, acookie,
ports, dif, sdif))) { ports, dif, sdif))) {
sock_gen_put(sk); sock_gen_put(sk);
goto begin; goto begin;
...@@ -426,7 +426,7 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row, ...@@ -426,7 +426,7 @@ static int __inet_check_established(struct inet_timewait_death_row *death_row,
if (sk2->sk_hash != hash) if (sk2->sk_hash != hash)
continue; continue;
if (likely(INET_MATCH(net, sk2, acookie, ports, dif, sdif))) { if (likely(inet_match(net, sk2, acookie, ports, dif, sdif))) {
if (sk2->sk_state == TCP_TIME_WAIT) { if (sk2->sk_state == TCP_TIME_WAIT) {
tw = inet_twsk(sk2); tw = inet_twsk(sk2);
if (twsk_unique(sk, sk2, twp)) if (twsk_unique(sk, sk2, twp))
...@@ -492,7 +492,7 @@ static bool inet_ehash_lookup_by_sk(struct sock *sk, ...@@ -492,7 +492,7 @@ static bool inet_ehash_lookup_by_sk(struct sock *sk,
if (esk->sk_hash != sk->sk_hash) if (esk->sk_hash != sk->sk_hash)
continue; continue;
if (sk->sk_family == AF_INET) { if (sk->sk_family == AF_INET) {
if (unlikely(INET_MATCH(net, esk, acookie, if (unlikely(inet_match(net, esk, acookie,
ports, dif, sdif))) { ports, dif, sdif))) {
return true; return true;
} }
......
...@@ -2563,7 +2563,7 @@ static struct sock *__udp4_lib_demux_lookup(struct net *net, ...@@ -2563,7 +2563,7 @@ static struct sock *__udp4_lib_demux_lookup(struct net *net,
struct sock *sk; struct sock *sk;
udp_portaddr_for_each_entry_rcu(sk, &hslot2->head) { udp_portaddr_for_each_entry_rcu(sk, &hslot2->head) {
if (INET_MATCH(net, sk, acookie, ports, dif, sdif)) if (inet_match(net, sk, acookie, ports, dif, sdif))
return sk; return sk;
/* Only check first socket in chain */ /* Only check first socket in chain */
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment