aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/raw.c
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-06-19 16:29:27 -0700
committerDavid S. Miller <davem@davemloft.net>2022-06-20 09:10:13 +0100
commitf289c02bf41b55fbfccf21d72c4ac44cd4a7a107 (patch)
tree8a90d3251bf1e6c02a45be0667b0147aa5c5765a /net/ipv4/raw.c
parentraw: Fix mixed declarations error in raw_icmp_error(). (diff)
downloadlinux-dev-f289c02bf41b55fbfccf21d72c4ac44cd4a7a107.tar.xz
linux-dev-f289c02bf41b55fbfccf21d72c4ac44cd4a7a107.zip
raw: Use helpers for the hlist_nulls variant.
hlist_nulls_add_head_rcu() and hlist_nulls_for_each_entry() have dedicated macros for sk. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r--net/ipv4/raw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index b3b255db9021..959bea12dc48 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -96,7 +96,7 @@ int raw_hash_sk(struct sock *sk)
hlist = &h->ht[inet_sk(sk)->inet_num & (RAW_HTABLE_SIZE - 1)];
write_lock_bh(&h->lock);
- hlist_nulls_add_head_rcu(&sk->sk_nulls_node, hlist);
+ __sk_nulls_add_node_rcu(sk, hlist);
sock_set_flag(sk, SOCK_RCU_FREE);
write_unlock_bh(&h->lock);
sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
@@ -172,7 +172,7 @@ static int raw_v4_input(struct sk_buff *skb, const struct iphdr *iph, int hash)
hlist = &raw_v4_hashinfo.ht[hash];
rcu_read_lock();
- hlist_nulls_for_each_entry(sk, hnode, hlist, sk_nulls_node) {
+ sk_nulls_for_each(sk, hnode, hlist) {
if (!raw_v4_match(net, sk, iph->protocol,
iph->saddr, iph->daddr, dif, sdif))
continue;
@@ -275,7 +275,7 @@ void raw_icmp_error(struct sk_buff *skb, int protocol, u32 info)
hlist = &raw_v4_hashinfo.ht[hash];
rcu_read_lock();
- hlist_nulls_for_each_entry(sk, hnode, hlist, sk_nulls_node) {
+ sk_nulls_for_each(sk, hnode, hlist) {
iph = (const struct iphdr *)skb->data;
if (!raw_v4_match(net, sk, iph->protocol,
iph->saddr, iph->daddr, dif, sdif))
@@ -954,7 +954,7 @@ static struct sock *raw_get_first(struct seq_file *seq, int bucket)
for (state->bucket = bucket; state->bucket < RAW_HTABLE_SIZE;
++state->bucket) {
hlist = &h->ht[state->bucket];
- hlist_nulls_for_each_entry(sk, hnode, hlist, sk_nulls_node) {
+ sk_nulls_for_each(sk, hnode, hlist) {
if (sock_net(sk) == seq_file_net(seq))
return sk;
}