diff options
author | Eric Dumazet <edumazet@google.com> | 2025-03-12 08:22:48 +0000 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2025-03-18 13:18:36 +0100 |
commit | a2fb987c0ecf0498cc17056339cb11d128c46ab7 (patch) | |
tree | eda94b14bd360cf46566e3294af9e52bff94e6e1 | |
parent | ae2d90355aa5592b0e99c8bbb4c3fa1d8e205f1b (diff) |
ipv4: frags: remove ipq_put()
Replace ipq_put() with inet_frag_putn()
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250312082250.1803501-3-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r-- | net/ipv4/ip_fragment.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c index 474a26191c89..ee953be49b34 100644 --- a/net/ipv4/ip_fragment.c +++ b/net/ipv4/ip_fragment.c @@ -107,14 +107,6 @@ static void ip4_frag_free(struct inet_frag_queue *q) inet_putpeer(qp->peer); } - -/* Destruction primitives. */ - -static void ipq_put(struct ipq *ipq) -{ - inet_frag_putn(&ipq->q, 1); -} - /* Kill ipq entry. It is not destroyed immediately, * because caller (and someone more) holds reference count. */ @@ -143,6 +135,7 @@ static void ip_expire(struct timer_list *t) struct sk_buff *head = NULL; struct net *net; struct ipq *qp; + int refs = 1; qp = container_of(frag, struct ipq, q); net = qp->q.fqdir->net; @@ -202,7 +195,7 @@ out: out_rcu_unlock: rcu_read_unlock(); kfree_skb_reason(head, reason); - ipq_put(qp); + inet_frag_putn(&qp->q, refs); } /* Find the correct entry in the "incomplete datagrams" queue for @@ -498,14 +491,14 @@ int ip_defrag(struct net *net, struct sk_buff *skb, u32 user) /* Lookup (or create) queue header */ qp = ip_find(net, ip_hdr(skb), user, vif); if (qp) { - int ret; + int ret, refs = 1; spin_lock(&qp->q.lock); ret = ip_frag_queue(qp, skb); spin_unlock(&qp->q.lock); - ipq_put(qp); + inet_frag_putn(&qp->q, refs); return ret; } |