Skip to content

Commit

Permalink
netns: Fix reassembly timer to use the right namespace
Browse files Browse the repository at this point in the history
This trivial fix retrieves the network namespace from frag queue
and use it to get the network device in the right namespace.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Daniel Lezcano authored and David S. Miller committed May 3, 2008
1 parent aaf8cdc commit 4ac2ccd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv6/reassembly.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ static void ip6_frag_expire(unsigned long data)
{
struct frag_queue *fq;
struct net_device *dev = NULL;
struct net *net;

fq = container_of((struct inet_frag_queue *)data, struct frag_queue, q);

Expand All @@ -207,7 +208,8 @@ static void ip6_frag_expire(unsigned long data)

fq_kill(fq);

dev = dev_get_by_index(&init_net, fq->iif);
net = container_of(fq->q.net, struct net, ipv6.frags);
dev = dev_get_by_index(net, fq->iif);
if (!dev)
goto out;

Expand Down

0 comments on commit 4ac2ccd

Please sign in to comment.