diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-11-14 13:57:53 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-11-16 09:43:35 +0000 |
commit | 919dfa0b20ae56060dce0436eb710717f8987d18 (patch) | |
tree | 9980af436954a96b7aa998728f47740a55106996 /net/ipv6 | |
parent | e88225656d302eb369668003a622b7a7baef1f43 (diff) |
udp: Clean up some functions.
This patch adds no functional change and cleans up some functions
that the following patches touch around so that we make them tidy
and easy to review/revert. The change is mainly to keep reverse
christmas tree order.
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/udp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index e2de3d906c82..727de67e4c90 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c @@ -1064,12 +1064,16 @@ static struct sock *__udp6_lib_demux_lookup(struct net *net, int dif, int sdif) { unsigned short hnum = ntohs(loc_port); - unsigned int hash2 = ipv6_portaddr_hash(net, loc_addr, hnum); - unsigned int slot2 = hash2 & udp_table.mask; - struct udp_hslot *hslot2 = &udp_table.hash2[slot2]; - const __portpair ports = INET_COMBINED_PORTS(rmt_port, hnum); + unsigned int hash2, slot2; + struct udp_hslot *hslot2; + __portpair ports; struct sock *sk; + hash2 = ipv6_portaddr_hash(net, loc_addr, hnum); + slot2 = hash2 & udp_table.mask; + hslot2 = &udp_table.hash2[slot2]; + ports = INET_COMBINED_PORTS(rmt_port, hnum); + udp_portaddr_for_each_entry_rcu(sk, &hslot2->head) { if (sk->sk_state == TCP_ESTABLISHED && inet6_match(net, sk, rmt_addr, loc_addr, ports, dif, sdif)) |