summaryrefslogtreecommitdiff
path: root/net/ipv6/reassembly.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-05-24 09:03:38 -0700
committerDavid S. Miller <davem@davemloft.net>2019-05-26 14:08:05 -0700
commita39aca678a0626941aa99c18c1c452ca758e7865 (patch)
treef7b16eb9d746b1afe0b8b70c78c5bc197aef0ca4 /net/ipv6/reassembly.c
parent9cce45f22ceedf639cbb5fb5dfe612a278d36b58 (diff)
net: add a net pointer to struct fqdir
fqdir will soon be dynamically allocated. We need to reach the struct net pointer from fqdir, so add it, and replace the various container_of() constructs by direct access to the new field. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/reassembly.c')
-rw-r--r--net/ipv6/reassembly.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 8235c5a8e8fe..a6f26aa648fb 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -76,12 +76,10 @@ static void ip6_frag_expire(struct timer_list *t)
{
struct inet_frag_queue *frag = from_timer(frag, t, timer);
struct frag_queue *fq;
- struct net *net;
fq = container_of(frag, struct frag_queue, q);
- net = container_of(fq->q.fqdir, struct net, ipv6.fqdir);
- ip6frag_expire_frag_queue(net, fq);
+ ip6frag_expire_frag_queue(fq->q.fqdir->net, fq);
}
static struct frag_queue *
@@ -254,7 +252,7 @@ err:
static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *skb,
struct sk_buff *prev_tail, struct net_device *dev)
{
- struct net *net = container_of(fq->q.fqdir, struct net, ipv6.fqdir);
+ struct net *net = fq->q.fqdir->net;
unsigned int nhoff;
void *reasm_data;
int payload_len;
@@ -516,7 +514,7 @@ static int __net_init ipv6_frags_init_net(struct net *net)
net->ipv6.fqdir.low_thresh = IPV6_FRAG_LOW_THRESH;
net->ipv6.fqdir.timeout = IPV6_FRAG_TIMEOUT;
- res = fqdir_init(&net->ipv6.fqdir, &ip6_frags);
+ res = fqdir_init(&net->ipv6.fqdir, &ip6_frags, net);
if (res < 0)
return res;