linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Richard Gobert <richardbgobert@gmail.com>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, corbet@lwn.net, yoshfuji@linux-ipv6.org,
	dsahern@kernel.org, alex.aring@gmail.com,
	stefan@datenfreihafen.org, pablo@netfilter.org,
	kadlec@netfilter.org, fw@strlen.de, kafai@fb.com,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-wpan@vger.kernel.org,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org
Subject: [PATCH 2/4] net-next: ip6: fetch inetpeer in ip6frag_init
Date: Mon, 29 Aug 2022 13:46:08 +0200	[thread overview]
Message-ID: <20220829114600.GA2374@debian> (raw)

Obtain the IPv6 peer in ip6frag_init, to allow for peer memory tracking
in the IPv6 fragment reassembly logic.

Signed-off-by: Richard Gobert <richardbgobert@gmail.com>
---
 include/net/ipv6_frag.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/net/ipv6_frag.h b/include/net/ipv6_frag.h
index 5052c66e22d2..62760cd3bdd1 100644
--- a/include/net/ipv6_frag.h
+++ b/include/net/ipv6_frag.h
@@ -6,6 +6,7 @@
 #include <net/addrconf.h>
 #include <net/ipv6.h>
 #include <net/inet_frag.h>
+#include <net/inetpeer.h>
 
 enum ip6_defrag_Richard Goberts {
 	IP6_DEFRAG_LOCAL_DELIVER,
@@ -33,9 +34,11 @@ static inline void ip6frag_init(struct inet_frag_queue *q, const void *a)
 {
 	struct frag_queue *fq = container_of(q, struct frag_queue, q);
 	const struct frag_v6_compare_key *key = a;
+	const struct net *net = q->fqdir->net;
 
 	q->key.v6 = *key;
 	fq->ecn = 0;
+	q->peer = inet_getpeer_v6(net->ipv6.peers, &key->saddr, 1);
 }
 
 static inline u32 ip6frag_key_hashfn(const void *data, u32 len, u32 seed)
-- 
2.36.1


             reply	other threads:[~2022-08-29 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 11:46 Richard Gobert [this message]
2022-08-29 22:20 ` [PATCH 2/4] net-next: ip6: fetch inetpeer in ip6frag_init Eric Dumazet
2022-09-01 14:48   ` Richard Gobert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220829114600.GA2374@debian \
    --to=richardbgobert@gmail.com \
    --cc=alex.aring@gmail.com \
    --cc=corbet@lwn.net \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=kadlec@netfilter.org \
    --cc=kafai@fb.com \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=stefan@datenfreihafen.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).